holdenk commented on a change in pull request #31071:
URL: https://github.com/apache/spark/pull/31071#discussion_r553113611



##########
File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsSnapshot.scala
##########
@@ -86,10 +86,13 @@ object ExecutorPodsSnapshot extends Logging {
             sparkContainerStatusOpt match {
               case Some(sparkContainerStatus) =>
                 sparkContainerStatus.getState.getTerminated match {
+                  // If there is no terminated state we are running.
+                  case null => PodRunning(pod)
                   case t if t.getExitCode != 0 =>
                     PodFailed(pod)
                   case t if t.getExitCode == 0 =>
                     PodSucceeded(pod)
+                  // Fall through case
                   case _ =>

Review comment:
       We shouldn't but this is to prevent the spurious "non-exhaustive match" 
warning.

##########
File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsSnapshot.scala
##########
@@ -86,10 +86,13 @@ object ExecutorPodsSnapshot extends Logging {
             sparkContainerStatusOpt match {
               case Some(sparkContainerStatus) =>
                 sparkContainerStatus.getState.getTerminated match {
+                  // If there is no terminated state we are running.
+                  case null => PodRunning(pod)

Review comment:
       Sure, so the NPE is triggered if there is no terminated state when we . 
Do we want to put that in the comments?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to