Github user ash211 commented on a diff in the pull request: https://github.com/apache/spark/pull/18877#discussion_r132583520 --- Diff: launcher/src/main/java/org/apache/spark/launcher/ChildProcAppHandle.java --- @@ -118,14 +116,40 @@ void setChildProc(Process childProc, String loggerName, InputStream logStream) { this.childProc = childProc; if (logStream != null) { this.redirector = new OutputRedirector(logStream, loggerName, - SparkLauncher.REDIRECTOR_FACTORY); + SparkLauncher.REDIRECTOR_FACTORY, this); + } else { + // If there is no log redirection, spawn a thread that will wait for the child process + // to finish. + Thread waiter = SparkLauncher.REDIRECTOR_FACTORY.newThread(this::monitorChild); + waiter.setDaemon(true); + waiter.start(); } } void setConnection(LauncherConnection connection) { this.connection = connection; } + /** + * Callback for when the child process exits. Forcefully put the application in a final state, + * overwriting the current final state unless it is already FAILED. + */ + synchronized void childProcessExited() { + disconnect(); + + int ec; + try { + ec = childProc.exitValue(); + } catch (Exception e) { --- End diff -- might want to log the exception here
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org