You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "xiongbo-sjtu (via GitHub)" <gi...@apache.org> on 2023/09/27 03:16:06 UTC

[GitHub] [spark] xiongbo-sjtu commented on a diff in pull request #43021: [SPARK-45227][CORE] Fix a subtle thread-safety issue with CoarseGrainedExecutorBackend

xiongbo-sjtu commented on code in PR #43021:
URL: https://github.com/apache/spark/pull/43021#discussion_r1337996350


##########
core/src/test/scala/org/apache/spark/executor/CoarseGrainedExecutorBackendSuite.scala:
##########
@@ -302,7 +302,12 @@ class CoarseGrainedExecutorBackendSuite extends SparkFunSuite
           resourceProfile = ResourceProfile.getOrCreateDefaultProfile(conf))
       assert(backend.taskResources.isEmpty)
 
-      val taskId = 1000000
+      // Ensure thread-safety (https://issues.apache.org/jira/browse/SPARK-45227)
+      assert(backend.taskResources.isInstanceOf[
+        ConcurrentMap[Long, Map[String, ResourceInformation]]
+      ])

Review Comment:
   The above `assert` logic was added so that the thread-safety data structure (i.e., CMH) will not be unintentionally refactored away later.  That's why I think that it's better for us to keep the logic here.



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

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


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