zwangsheng commented on code in PR #40118:
URL: https://github.com/apache/spark/pull/40118#discussion_r1151451312
##########
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:
We can normalize this exception and throw it because this is not the
expected behavior (Driver container completed without exitCode)
--
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]