Skip to content

Commit c6a5c6e

Browse files
ash211foxish
authored andcommitted
Stop executors cleanly before deleting their pods (apache#231)
1 parent 13f16d5 commit c6a5c6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/kubernetes/KubernetesClusterSchedulerBackend.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ private[spark] class KubernetesClusterSchedulerBackend(
131131
}
132132

133133
override def stop(): Unit = {
134+
// send stop message to executors so they shut down cleanly
135+
super.stop()
136+
137+
// then delete the executor pods
134138
// TODO investigate why Utils.tryLogNonFatalError() doesn't work in this context.
135139
// When using Utils.tryLogNonFatalError some of the code fails but without any logs or
136140
// indication as to why.
@@ -149,7 +153,6 @@ private[spark] class KubernetesClusterSchedulerBackend(
149153
} catch {
150154
case e: Throwable => logError("Uncaught exception closing Kubernetes client.", e)
151155
}
152-
super.stop()
153156
}
154157

155158
private def allocateNewExecutorPod(): (String, Pod) = {

0 commit comments

Comments
 (0)