vanzin commented on a change in pull request #26440: 
[WIP][SPARK-20628][CORE][K8S] Start to improve Spark decommissioning & 
preemption support
URL: https://github.com/apache/spark/pull/26440#discussion_r364994738
 
 

 ##########
 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:
   My question is more in the lines of: since this will be triggered by Spark 
itself killing executors, will everything else triggered by this script behave 
correctly when Spark itself, and not the cluster, is requesting that the 
executor be killed?
   
   e.g. now you have an executor being killed that some other code might try to 
decommission and those are all tracked in separate places, and might get out of 
sync.

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

Reply via email to