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 2021/09/14 02:45:58 UTC

[GitHub] [spark] mridulm commented on a change in pull request #33984: [SPARK-36705][FOLLOW-UP] Fix unnecessary logWarning when PUSH_BASED_SHUFFLE_ENABLED is set to false

mridulm commented on a change in pull request #33984:
URL: https://github.com/apache/spark/pull/33984#discussion_r707865190



##########
File path: core/src/main/scala/org/apache/spark/util/Utils.scala
##########
@@ -2604,18 +2604,19 @@ private[spark] object Utils extends Logging {
    *   - serializer(such as KryoSerializer) supports relocation of serialized objects
    */
   def isPushBasedShuffleEnabled(conf: SparkConf): Boolean = {
+    val shouldDoPushBasedShuffle = conf.get(PUSH_BASED_SHUFFLE_ENABLED)
     val serializer = Utils.classForName(conf.get(SERIALIZER)).getConstructor(classOf[SparkConf])
       .newInstance(conf).asInstanceOf[Serializer]
     val canDoPushBasedShuffle =
-      conf.get(PUSH_BASED_SHUFFLE_ENABLED) &&
+      shouldDoPushBasedShuffle &&
         (conf.get(IS_TESTING).getOrElse(false) ||
           (conf.get(SHUFFLE_SERVICE_ENABLED) &&
             conf.get(SparkLauncher.SPARK_MASTER, null) == "yarn" &&
             // TODO: [SPARK-36744] needs to support IO encryption for push-based shuffle
             !conf.get(IO_ENCRYPTION_ENABLED) &&
             serializer.supportsRelocationOfSerializedObjects))

Review comment:
       Can we move this block if `shouldDoPushBasedShuffle` is true ?
   Something like:
   ```
     val pushBasedShuffleEnabled = conf.get(PUSH_BASED_SHUFFLE_ENABLED)
     if (pushBasedShuffleEnabled) {
       val serializer = ...
       val canDoPushBasedShuffle = conf.get(IS_TESTING).getOrElse(false) ||
         (conf.get(SHUFFLE_SERVICE_ENABLED) && ...
   
       if (!canDoPushBasedShuffle) {
         logWarning(" ...")
       }
   
       canDoPushBasedShuffle
     } else {
       false
     }
   }
   
   ```




-- 
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