tgravescs commented on a change in pull request #27773: [SPARK-29154][CORE] 
Update Spark scheduler for stage level scheduling
URL: https://github.com/apache/spark/pull/27773#discussion_r389782696
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/resource/ResourceProfileManager.scala
 ##########
 @@ -64,8 +64,10 @@ private[spark] class ResourceProfileManager(sparkConf: 
SparkConf) extends Loggin
     isSupported(rp)
     // force the computation of maxTasks and limitingResource now so we don't 
have cost later
     rp.limitingResource(sparkConf)
-    logInfo(s"Adding ResourceProfile id: ${rp.id}")
-    resourceProfileIdToResourceProfile.putIfAbsent(rp.id, rp)
+    val res = resourceProfileIdToResourceProfile.putIfAbsent(rp.id, rp)
+    if (res == null) {
+      logInfo(s"Added ResourceProfile id: ${rp.id}")
 
 Review comment:
   also note that adding a resourceprofile multiple times (rdd.withResources) 
doesn't leave around old resource profiles, its when they actually create the 
resourceProfile that it gets a separate id.
   This pr has the RDD.withResources in now for testing purposes, so we can 
leave this conversation til the Pr that opens it up but I was trying to decide 
whether we only allow setting it once per RDD , left it out here as I was still 
thinking about that.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to