dongjoon-hyun commented on a change in pull request #33508:
URL: https://github.com/apache/spark/pull/33508#discussion_r679390549
##########
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
+ val podName = pod.getMetadata.getName
+ podName match {
+ case execIdRE(id) =>
+ (id.toLong, toState(pod))
+ case _ =>
+ throw new Exception(s"Failed to parse podname ${podName}")
Review comment:
Let's use a specific exception instead of `Exception`. At least,
`SparkException` is better?
--
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]