Github user lianhuiwang commented on a diff in the pull request:
https://github.com/apache/spark/pull/3962#discussion_r22910255
--- Diff:
yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala ---
@@ -474,13 +482,17 @@ private[spark] class ApplicationMaster(args:
ApplicationMasterArguments,
// we can monitor Lifecycle Events.
driver ! "Hello"
driver ! RegisterClusterManager
- context.system.eventStream.subscribe(self,
classOf[RemotingLifecycleEvent])
+ if (isDriver) {
+ context.system.eventStream.subscribe(self,
classOf[RemotingLifecycleEvent])
+ }
}
override def receive = {
case x: DisassociatedEvent =>
logInfo(s"Driver terminated or disconnected! Shutting down. $x")
- finish(FinalApplicationStatus.SUCCEEDED,
ApplicationMaster.EXIT_SUCCESS)
+ if (!isDriver) {
+ finish(FinalApplicationStatus.SUCCEEDED,
ApplicationMaster.EXIT_SUCCESS)
+ }
--- End diff --
yes, when in cluster mode, driver is user class's main method. when driver
terminated or disconnected, AM can monitor and can determine whether main class
is success or not. so there is not needed.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]