You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/03/06 18:17:19 UTC

[GitHub] [spark] khogeland commented on a change in pull request #27568: [SPARK-30821][K8S]Handle container failure in executor pods with multiple containers

khogeland commented on a change in pull request #27568: [SPARK-30821][K8S]Handle container failure in executor pods with multiple containers
URL: https://github.com/apache/spark/pull/27568#discussion_r389063862
 
 

 ##########
 File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsSnapshot.scala
 ##########
 @@ -59,6 +60,14 @@ object ExecutorPodsSnapshot extends Logging {
         case "pending" =>
           PodPending(pod)
         case "running" =>
+          // A pod will be considered running as long as there is at least one running container,
+          // so we need to check if there are any failed containers.
+          if (pod.getSpec.getRestartPolicy.equals("Never") &&
+            pod.getStatus.getContainerStatuses.stream
+            .map[ContainerStateTerminated](cs => cs.getState.getTerminated)
+            .anyMatch(t => t != null && t.getExitCode != 0)) {
+              PodFailed(pod)
+          }
           PodRunning(pod)
 
 Review comment:
   Hm, why do you say line 69 is ignored? The unit test should be proof that this works.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org