GitHub user zsxwing opened a pull request:
https://github.com/apache/spark/pull/2732
[SPARK-3877] Throw an exception when application is not successful so that
the exit code wil be set to 1
When an yarn application fails (yarn-cluster mode), the exit code of
spark-submit is still 0. It's hard for people to write some automatic scripts
to run spark jobs in yarn because the failure can not be detected in these
scripts.
This PR added a status checking after `monitorApplication`. If an
application is not successful, `run()` will throw an `SparkException`, so that
Client.scala will exit with code 1. Therefore, people can use the exit code of
`spark-submit` to write some automatic tasks.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zsxwing/spark SPARK-3877
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/2732.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 #2732
----
commit 6a2c103b9514b085fb5b139f859cde1cbf1a048e
Author: zsxwing <[email protected]>
Date: 2014-10-09T09:57:02Z
[SPARK-3877] Throw an exception when application is not successful so that
the exit code wil be set to 1
----
---
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]