cchriswu commented on a change in pull request #32752:
URL: https://github.com/apache/spark/pull/32752#discussion_r645249759



##########
File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocator.scala
##########
@@ -99,6 +102,17 @@ private[spark] class ExecutorPodsAllocator(
   @volatile private var deletedExecutorIds = Set.empty[Long]
 
   def start(applicationId: String, schedulerBackend: 
KubernetesClusterSchedulerBackend): Unit = {
+    // Wait until the driver pod is ready before starting executors, as the 
headless service won't
+    // be resolvable by DNS until the driver pod is ready.
+    try {
+      kubernetesClient.pods()
+        .withName(kubernetesDriverPodName.get)
+        .waitUntilReady(driverPodReadinessTimeout, TimeUnit.MINUTES)
+    } catch {
+      case e: InterruptedException =>
+        logWarning(s"Timeout waiting for driver pod 
${kubernetesDriverPodName.get} get ready in " +
+          s"namespace $namespace")
+    }

Review comment:
       As the [JIRA issue](https://issues.apache.org/jira/browse/SPARK-32975) 
describes, driver will not create new executors when this error happens.
   > Once this error happens, driver doesn't restart executor.
   
   However, other executors may be running fine. It's just that the number of 
healthy executors will be less than expected.    So I agree not to use 
`SparkException` 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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to