dongjoon-hyun commented on a change in pull request #28053: 
[SPARK-29153][CORE]Add ability to merge resource profiles within a stage with 
Stage Level Scheduling
URL: https://github.com/apache/spark/pull/28053#discussion_r399466257
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/resource/ResourceProfileManager.scala
 ##########
 @@ -73,11 +73,19 @@ private[spark] class ResourceProfileManager(sparkConf: 
SparkConf) extends Loggin
    * Gets the ResourceProfile associated with the id, if a profile doesn't 
exist
    * it returns the default ResourceProfile created from the application level 
configs.
    */
-  def resourceProfileFromId(rpId: Int): ResourceProfile = {
-    val rp = resourceProfileIdToResourceProfile.get(rpId)
-    if (rp == null) {
+  def resourceProfileFromId(rpId: Int): ResourceProfile = synchronized {
 
 Review comment:
   Could you use `ReadWriteLock`? It seems that `addResourceProfile` is the 
only operation that needs `WriteLock`.

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