GitHub user jerryshao opened a pull request:
https://github.com/apache/spark/pull/11690
[SPARK-13642][Yarn][1.6-backport] Properly handle signal kill in
ApplicationMaster
## What changes were proposed in this pull request?
This patch is fixing the race condition in ApplicationMaster when receiving
a signal. In the current implementation, if signal is received and with no any
exception, this application will be finished with successful state in Yarn, and
there's no another attempt. Actually the application is killed by signal in the
runtime, so another attempt is expected.
This patch adds a signal handler to handle the signal things, if signal is
received, marking this application finished with failure, rather than success.
## How was this patch tested?
This patch is tested with following situations:
Application is finished normally.
Application is finished by calling System.exit(n).
Application is killed by yarn command.
ApplicationMaster is killed by "SIGTERM" send by kill pid command.
ApplicationMaster is killed by NM with "SIGTERM" in case of NM failure.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jerryshao/apache-spark
SPARK-13642-1.6-backport
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11690.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11690
----
commit 8eed861255403680aaffc66b6c61704a4591c93a
Author: jerryshao <[email protected]>
Date: 2016-03-04T05:52:18Z
Properly handle signal kill in ApplicationMaster
commit 57d37d91e09e05d7b2d902dfb68bbc46205c53a6
Author: jerryshao <[email protected]>
Date: 2016-03-14T06:41:46Z
change the log
----
---
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]