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_r389778059
 
 

 ##########
 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:
   currently I'm not removing the old resource profiles as they could be used 
elsewhere and its a bit hard to know when you are done using them. I don't 
expect people to use many of them (but as we know lots of people use things 
unexpectedly). But I have a follow up jira to go figure out a way to remove 
unused ones. https://issues.apache.org/jira/browse/SPARK-30749

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