Ngone51 commented on a change in pull request #28258:
URL: https://github.com/apache/spark/pull/28258#discussion_r433591599
##########
File path: core/src/main/scala/org/apache/spark/deploy/Client.scala
##########
@@ -124,58 +138,84 @@ private class ClientEndpoint(
}
}
- /* Find out driver status then exit the JVM */
- def pollAndReportStatus(driverId: String): Unit = {
- // Since ClientEndpoint is the only RpcEndpoint in the process, blocking
the event loop thread
- // is fine.
- logInfo("... waiting before polling master for driver state")
- Thread.sleep(5000)
- logInfo("... polling master for driver state")
- val statusResponse =
-
activeMasterEndpoint.askSync[DriverStatusResponse](RequestDriverStatus(driverId))
- if (statusResponse.found) {
- logInfo(s"State of $driverId is ${statusResponse.state.get}")
- // Worker node, if present
- (statusResponse.workerId, statusResponse.workerHostPort,
statusResponse.state) match {
- case (Some(id), Some(hostPort), Some(DriverState.RUNNING)) =>
- logInfo(s"Driver running on $hostPort ($id)")
- case _ =>
+ private def monitorDriverStatus(): Unit = {
+ if (submittedDriverID != "") {
+
asyncSendToMasterAndForwardReply[DriverStatusResponse](RequestDriverStatus(submittedDriverID))
+ }
+ }
+
+ /**
+ * Processes and reports the driver status then exit the JVM if the
+ * waitAppCompletion is set to false, else reports the driver status
+ * if debug logs are enabled.
+ */
+ def reportDriverStatus(found: Boolean, state: Option[DriverState],
+ workerId: Option[String],
+ workerHostPort: Option[String],
+ exception: Option[Exception]): Unit = {
Review comment:
nit:
```suggestion
def reportDriverStatus(
found: Boolean,
state: Option[DriverState],
workerId: Option[String],
workerHostPort: Option[String],
exception: Option[Exception]): Unit = {
```
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]