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