GitHub user jerryshao opened a pull request:
https://github.com/apache/spark/pull/11512
[SPARK-13642][Yarn] 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:
1. Application is finished normally.
2. Application is finished by calling `System.exit(n)`.
3. Application is killed by yarn command.
4. ApplicationMaster is killed by "SIGTERM" send by `kill pid` command.
5. ApplicationMaster is killed by NM with "SIGTERM" in case of NM failure.
All the scenarios return the expected states.
CC @tgravescs , please help to review this fix, thanks a lot.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jerryshao/apache-spark SPARK-13642
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11512.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 #11512
----
commit b461b717ed51b532f823615bcb79f66b17635c4d
Author: jerryshao <[email protected]>
Date: 2016-03-04T05:52:18Z
Properly handle signal kill in ApplicationMaster
----
---
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]