gengliangwang commented on code in PR #46309:
URL: https://github.com/apache/spark/pull/46309#discussion_r1585606860


##########
core/src/main/scala/org/apache/spark/resource/ResourceUtils.scala:
##########
@@ -454,14 +455,21 @@ private[spark] object ResourceUtils extends Logging {
     if (limitingResource.nonEmpty && 
!limitingResource.equals(ResourceProfile.CPUS)) {
       if ((taskCpus * maxTaskPerExec) < cores) {
         val resourceNumSlots = Math.floor(cores/taskCpus).toInt
-        val message = s"The configuration of cores (exec = ${cores} " +
-          s"task = ${taskCpus}, runnable tasks = ${resourceNumSlots}) will " +
-          s"result in wasted resources due to resource ${limitingResource} 
limiting the " +
-          s"number of runnable tasks per executor to: ${maxTaskPerExec}. 
Please adjust " +
-          "your configuration."
         if (sparkConf.get(RESOURCES_WARNING_TESTING)) {
+          val message = s"The configuration of cores (exec = ${cores} " +

Review Comment:
   Same here. We can have only one message and use `message.message` in 
throwing exception.



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to