holdenk commented on a change in pull request #26440: [SPARK-20628][CORE][K8S]
Start to improve Spark decommissioning & preemption support
URL: https://github.com/apache/spark/pull/26440#discussion_r366674241
##########
File path:
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala
##########
@@ -192,6 +193,21 @@ private[spark] class BasicExecutorFeatureStep(
.endResources()
.build()
}.getOrElse(executorContainer)
+ val containerWithLifecycle = kubernetesConf.workerDecommissioning match {
+ case false =>
+ logInfo("Decommissioning not enabled, skipping shutdown script")
+ containerWithLimitCores
+ case true =>
+ logInfo("Adding decommission script to lifecycle")
+ new ContainerBuilder(containerWithLimitCores).withNewLifecycle()
+ .withNewPreStop()
Review comment:
So I did some looking in the code and how we remove executors during dynamic
allocation is a different mechanism. When we kill executors in the K8s backend
we first ask Spark to exit. If it doesn't exit (see L153) we do a delete. Now
the decommissioning would be triggered in that event and could keep the
executor alive for the length of the timeout period configured. I think that's
ok given that the timeout period should be set something not too long, and most
of the executors likely exit when asked by Spark and don't have to be cleaned
up by K8s. That being said if that is not OK from
https://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod/
it looks like K8s in 1.5+ supports force delition with no grace period
regardless of the pods configuration.
----------------------------------------------------------------
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]