You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2023/01/27 08:43:38 UTC

[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #39769: [SPARK-42190][K8S][FOLLOWUP] Fix to use the user-given number of threads

dongjoon-hyun commented on code in PR #39769:
URL: https://github.com/apache/spark/pull/39769#discussion_r1088705615


##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala:
##########
@@ -54,13 +54,14 @@ private[spark] class KubernetesClusterManager extends ExternalClusterManager wit
       scheduler: TaskScheduler): SchedulerBackend = {
     if (isLocal(sc.conf)) {
       def localCpuCount: Int = Runtime.getRuntime.availableProcessors()
-      val threadCount = masterURL match {
+      val threadCount = sc.conf.get(KUBERNETES_DRIVER_MASTER_URL) match {
         case LOCAL_N_REGEX(threads) =>
-          if (threads == "*") localCpuCount else 1
+          if (threads == "*") localCpuCount else threads.toInt
         case LOCAL_N_FAILURES_REGEX(threads, _) =>
-          if (threads == "*") localCpuCount else 1
+          if (threads == "*") localCpuCount else threads.toInt
         case _ => 1
       }
+      logInfo(s"Running Spark with ${sc.conf.get(KUBERNETES_DRIVER_MASTER_URL)}")

Review Comment:
   This is added for testing.
   ```
   23/01/27 08:42:45 INFO KubernetesClusterManager: Running Spark with local[10]
   ```



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