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

 ##########
 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:
   Is there'a way to clean old resource profile in case of a RDD calls 
`withResources` for multiple times?

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