akshatb1 commented on a change in pull request #28258: URL: https://github.com/apache/spark/pull/28258#discussion_r426130288
########## File path: core/src/main/scala/org/apache/spark/deploy/Client.scala ########## @@ -176,6 +190,25 @@ private class ClientEndpoint( } else if (!Utils.responseFromBackup(message)) { System.exit(-1) } + + case DriverStatusResponse(found, state, _, _, _) => + if (found) { + state.get match { + case DriverState.FINISHED | DriverState.FAILED | + DriverState.ERROR | DriverState.KILLED => + logInfo(s"State of $submittedDriverID is ${state.get}, " + + s"exiting spark-submit JVM.") + System.exit(0) + case _ => + Thread.sleep(REPORT_DRIVER_STATUS_INTERVAL) Review comment: @Ngone51 Thanks for reviewing. I tried simulating that case by increasing the `Thread.sleep `time and I see that `onDisconnected` is called when the master is stopped during sleep time and following logs are generated: ``` 20/05/16 13:24:44 ERROR ClientEndpoint: Error connecting to master 127.0.0.1:7077. 20/05/16 13:24:44 ERROR ClientEndpoint: No master is available, exiting. ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org