diff options
author | peng.zhang <peng.zhang@xiaomi.com> | 2016-07-01 15:51:21 -0700 |
---|---|---|
committer | Marcelo Vanzin <vanzin@cloudera.com> | 2016-07-01 15:51:21 -0700 |
commit | bad0f7dbba2eda149ee4fc5810674d971d17874a (patch) | |
tree | 03aa741f1ed2e98333f8a7332d801df23b1c7b63 /yarn/src/main/scala | |
parent | d17e5f2f123eecd5a7a1d87f5ce75a0fc44552b4 (diff) | |
download | spark-bad0f7dbba2eda149ee4fc5810674d971d17874a.tar.gz spark-bad0f7dbba2eda149ee4fc5810674d971d17874a.tar.bz2 spark-bad0f7dbba2eda149ee4fc5810674d971d17874a.zip |
[SPARK-16095][YARN] Yarn cluster mode should report correct state to SparkLauncher
## What changes were proposed in this pull request?
Yarn cluster mode should return correct state for SparkLauncher
## How was this patch tested?
unit test
Author: peng.zhang <peng.zhang@xiaomi.com>
Closes #13962 from renozhang/SPARK-16095-spark-launcher-wrong-state.
Diffstat (limited to 'yarn/src/main/scala')
-rw-r--r-- | yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala index d63579ff82..244d1a4e33 100644 --- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala +++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala @@ -1080,7 +1080,14 @@ private[spark] class Client( case YarnApplicationState.RUNNING => reportLauncherState(SparkAppHandle.State.RUNNING) case YarnApplicationState.FINISHED => - reportLauncherState(SparkAppHandle.State.FINISHED) + report.getFinalApplicationStatus match { + case FinalApplicationStatus.FAILED => + reportLauncherState(SparkAppHandle.State.FAILED) + case FinalApplicationStatus.KILLED => + reportLauncherState(SparkAppHandle.State.KILLED) + case _ => + reportLauncherState(SparkAppHandle.State.FINISHED) + } case YarnApplicationState.FAILED => reportLauncherState(SparkAppHandle.State.FAILED) case YarnApplicationState.KILLED => |