You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2023/03/29 04:15:54 UTC
[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #40118: [SPARK-26365][K8S] In kuberentes cluster mode, spark submit should pass driver exit code
dongjoon-hyun commented on code in PR #40118:
URL: https://github.com/apache/spark/pull/40118#discussion_r1151374762
##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/LoggingPodStatusWatcher.scala:
##########
@@ -95,6 +100,27 @@ private[k8s] class LoggingPodStatusWatcherImpl(conf: KubernetesDriverConf)
this.notifyAll()
}
+ override def getDriverExitCode(): Option[Int] = synchronized {
+ if (hasCompleted()) {
+ val driverContainerName = conf.get(KUBERNETES_DRIVER_PODTEMPLATE_CONTAINER_NAME)
+ .getOrElse(DEFAULT_DRIVER_CONTAINER_NAME)
+ pod.foreach { p =>
+ try {
+ return Some(p.getStatus.getContainerStatuses.asScala
+ .filter(driverContainerName == _.getName)
+ .head.getState.getTerminated.getExitCode)
+ } catch {
+ case _: NullPointerException =>
Review Comment:
Sorry but this could hide other important underlying exception. Do you think we can use more safer way?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org