Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/2311#discussion_r17251254
--- Diff:
yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
---
@@ -369,7 +378,17 @@ private[spark] class ApplicationMaster(args:
ApplicationMasterArguments,
// Some apps have "System.exit(0)" at the end. The user thread
will stop here unless
// it has an uncaught exception thrown out. It needs a shutdown
hook to set SUCCEEDED.
status = FinalApplicationStatus.SUCCEEDED
- } finally {
+ } catch {
+ case NoExitsException(exitCode) =>
+ exitStatus = exitCode
+ if (exitStatus == 0) {
+ status = FinalApplicationStatus.SUCCEEDED
+ }
+ case e: Throwable =>
--- End diff --
Better not to catch `Throwable`, and don't set `exitCode` to -1 (in the
shell, that translates to an exit code of 255, which is generally interpreted
to mean different things than just "process exited" [1].)
[1] Some discussion: http://en.wikipedia.org/wiki/Exit_status
---
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]