Skip to content

Commit 2a4cbb6

Browse files
committed
Fetch latest state before continuing
1 parent a9ce548 commit 2a4cbb6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientApplication.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ import java.util.{Collections, UUID}
2222
import java.util.Properties
2323

2424
import io.fabric8.kubernetes.api.model._
25+
import io.fabric8.kubernetes.client.Watcher.Action
2526
import io.fabric8.kubernetes.client.{KubernetesClient, KubernetesClientException, Watch}
27+
2628
import scala.collection.mutable
2729
import scala.util.control.NonFatal
2830
import util.control.Breaks._
29-
3031
import org.apache.spark.SparkConf
3132
import org.apache.spark.deploy.SparkApplication
3233
import org.apache.spark.deploy.k8s._
@@ -145,10 +146,9 @@ private[spark] class Client(
145146
breakable {
146147
while (true) {
147148
try {
148-
watch = kubernetesClient
149-
.pods()
150-
.withName(driverPodName)
151-
.watch(watcher)
149+
val podWithName = kubernetesClient.pods().withName(driverPodName)
150+
watch = podWithName.watch(watcher)
151+
watcher.eventReceived(Action.MODIFIED, podWithName.get())
152152
watcher.watchOrStop(sId)
153153
break
154154
} catch {

0 commit comments

Comments
 (0)