You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/04 13:24:09 UTC

[GitHub] [spark] pan3793 opened a new pull request, #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

pan3793 opened a new pull request, #38901:
URL: https://github.com/apache/spark/pull/38901

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   Fix the condition for judging Netty prefer direct memory on executor starting, it should be `PlatformDependent.directBufferPreferred() && env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true)` 
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   The check logical was added in SPARK-27991, the original intention is to avoiding potential Netty OOM issue when Netty uses direct memory to consume shuffle data, but the condition is not sufficient, `spark.shuffle.io.preferDirectBufs` should be checked as well.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   Manual testing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1040354493


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of
+      // org.apache.spark.network.client.TransportClientFactory
+      val sharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.sharedByteBufAllocators.enabled", true)
+      val preferDirectBufsForSharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.io.preferDirectBufs", true)
+      val preferDirectBufs =
+        env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true)

Review Comment:
   I see, make sense.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1341947314

   Thank you all.
   If this is caused by SPARK-27991 at Spark 3.2.0, do we need to backport to branch-3.3 and 3.2?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1039928534


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of
+      // org.apache.spark.network.client.TransportClientFactory
+      val sharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.sharedByteBufAllocators.enabled", true)
+      val preferDirectBufsForSharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.io.preferDirectBufs", true)
+      val preferDirectBufs =
+        env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true)

Review Comment:
   The spark preferDirectBufs affects the created `ByteBufAllocator`, see `org.apache.spark.network.util#createPooledByteBufAllocator`, when spark's `preferDirectBufs=false` and `PlatformDependent.directBufferPreferred()=true`, a `PreferHeapByteBufAllocator` will be created.
   
   Heap memory will be used unless call `PreferHeapByteBufAllocator#directBuffer` directly, I don't see any code of shuffle client calls that method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1040356678


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of

Review Comment:
   Shall we add this logic into a NettyUitls function?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1040374469


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of

Review Comment:
   I'm afraid not, `NettyUtils` located at `network-common`, it can not access `SparkConf` which in `core`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1040356257


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of
+      // org.apache.spark.network.client.TransportClientFactory
+      val sharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.sharedByteBufAllocators.enabled", true)
+      val preferDirectBufsForSharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.io.preferDirectBufs", true)
+      val preferDirectBufs =
+        env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true)

Review Comment:
   Did you see where is this conf accessed? I didn't find it used anywhere.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1341948947

   Thanks @dongjoon-hyun for checking, I think you are right, it should be ported to 3.2/3.3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on a diff in pull request #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1039086498


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,8 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      if (env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true) &&

Review Comment:
   It should be "and", see `NettyUtils#createPooledByteBufAllocator`, and wait, we should also check "spark.network.sharedByteBufAllocators.enabled" and "spark.network.io.preferDirectBufs", let me update.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on a diff in pull request #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1039094026


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,8 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      if (env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true) &&

Review Comment:
   OK so the setting is really only a way to disable, not enable, direct buffers



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
mridulm commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1336751517

   +CC @Ngone51 (who last updated this) and @cloud-fan (who merged the commit).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on pull request #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1336649430

   @srowen code and comment have been updated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1341788018

   Merged to master


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1336533550

   Can one of the admins verify this patch?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on a diff in pull request #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1039084916


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,8 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      if (env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true) &&

Review Comment:
   The configuration key and default value come from `TransportConf#preferDirectBufs`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1040709804


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of

Review Comment:
   How about NettyUtils just accept boolean inputs, not config



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on a diff in pull request #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1039085487


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,8 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      if (env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true) &&

Review Comment:
   No, I'm referring to the current condition that this adds to here. PlatformDependent.directBufferPreferred()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on pull request #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1336650284

   It's a bigger change, maybe someone with more understanding of the code can evaluate this


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1342570534

   @dongjoon-hyun I opened https://github.com/apache/spark/pull/38981 (for branch-3.3) and https://github.com/apache/spark/pull/38982 (for branch-3.2), please take a look.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1342175409

   Could you make a backporting PR, @pan3793 ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1341215501

   > is this the only place this check happens?
   
   I think yes.
   
   The following logic looks similar but not same, I think the existing code is clearly enough.
   
   https://github.com/apache/spark/blob/1d2159f888139e65c80db2003d521b0f684df83a/common/network-common/src/main/java/org/apache/spark/network/server/TransportServer.java#L73-L79
   
   https://github.com/apache/spark/blob/1d2159f888139e65c80db2003d521b0f684df83a/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java#L110-L116


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1040372045


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of
+      // org.apache.spark.network.client.TransportClientFactory
+      val sharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.sharedByteBufAllocators.enabled", true)
+      val preferDirectBufsForSharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.io.preferDirectBufs", true)
+      val preferDirectBufs =
+        env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true)

Review Comment:
   it's a combination of ("spark", module, "io.preferDirectBufs"), for shuffle client, the module is "shuffle", see `org.apache.spark.network.util.TransportConf`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on a diff in pull request #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1038978948


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,8 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      if (env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true) &&

Review Comment:
   Should this check be 'and' or 'or'? how is it implemented elsewhere? that is, should 'true' or 'false' setting of this value override the default?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen closed pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
srowen closed pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start
URL: https://github.com/apache/spark/pull/38901


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on pull request #38901: [SPARK-41376][CORE] Executor netty direct memory check should respect spark.shuffle.io.preferDirectBufs

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #38901:
URL: https://github.com/apache/spark/pull/38901#issuecomment-1336411603

   cc @Ngone51 @mridulm 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1039732976


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of
+      // org.apache.spark.network.client.TransportClientFactory
+      val sharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.sharedByteBufAllocators.enabled", true)
+      val preferDirectBufsForSharedByteBufAllocators =
+        env.conf.getBoolean("spark.network.io.preferDirectBufs", true)
+      val preferDirectBufs =
+        env.conf.getBoolean("spark.shuffle.io.preferDirectBufs", true)

Review Comment:
   Why should we limit the condition to the spark confs too? I think Netty would still use the direct buffers even if spark preferDirectBufs=false as long as PlatformDependent.directBufferPreferred()=true, no?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1040356678


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of

Review Comment:
   Shall add this logic into a NettyUitls function?



##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of

Review Comment:
   Shall wee add this logic into a NettyUitls function?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] pan3793 commented on a diff in pull request #38901: [SPARK-41376][CORE] Correct the Netty preferDirectBufs check logic on executor start

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #38901:
URL: https://github.com/apache/spark/pull/38901#discussion_r1041703045


##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -85,7 +85,19 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     logInfo("Connecting to driver: " + driverUrl)
     try {
-      if (PlatformDependent.directBufferPreferred() &&
+      // The following logic originally comes from the constructor of

Review Comment:
   Updated, @Ngone51 would you please take a look again?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org