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



##########
File path: 
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsSnapshot.scala
##########
@@ -61,7 +61,22 @@ object ExecutorPodsSnapshot extends Logging {
 
   private def toStatesByExecutorId(executorPods: Seq[Pod]): Map[Long, 
ExecutorPodState] = {
     executorPods.map { pod =>
-      (pod.getMetadata.getLabels.get(SPARK_EXECUTOR_ID_LABEL).toLong, 
toState(pod))
+      pod.getMetadata.getLabels.get(SPARK_EXECUTOR_ID_LABEL) match {
+        case "EXECID" | null =>
+          // The pod has been created by something other than Spark and we 
should process
+          // pod the name to get the ID instead of the label.
+          val execIdRE = ".+-([0-9]+)".r

Review comment:
       So the tests actually do that currently. Since the prefix (`.+`) is 
"greedy" ( https://docs.oracle.com/javase/tutorial/essential/regex/quant.html ) 
matching it'll only match the last numbers after the -.




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

To unsubscribe, e-mail: [email protected]

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