tgravescs commented on a change in pull request #25047: 
[WIP][SPARK-27371][CORE] Support GPU-aware resources scheduling in Standalone
URL: https://github.com/apache/spark/pull/25047#discussion_r308324119
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/SparkContext.scala
 ##########
 @@ -379,7 +389,24 @@ class SparkContext(config: SparkConf) extends Logging {
     _driverLogger = DriverLogger(_conf)
 
     val resourcesFileOpt = conf.get(DRIVER_RESOURCES_FILE)
-    _resources = getOrDiscoverAllResources(_conf, SPARK_DRIVER_PREFIX, 
resourcesFileOpt)
+    val discovered = getOrDiscoverAllResources(_conf, SPARK_DRIVER_PREFIX, 
resourcesFileOpt)
+    _resources = {
+      // driver submitted in client mode under Standalone may have conflicting 
resources with
+      // workers on this host. We should sync driver's resources info into 
SPARK_RESOURCES
+      // to avoid collision.
+      if (isClientStandalone) {
+        val requests = parseResourceRequirements(_conf, SPARK_DRIVER_PREFIX)
+        try {
+          acquireResources(_conf, SPARK_DRIVER_PREFIX, discovered, requests, 
Utils.getProcessId)
+        } catch {
+          case NonFatal(e) =>
 
 Review comment:
   why catch and just rethrow here?  did you intend to add log message, 
otherwise I think we can remove

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