diff options
author | BlackNiuza <shiyun.wxm@taobao.com> | 2013-07-10 19:11:43 +0800 |
---|---|---|
committer | BlackNiuza <shiyun.wxm@taobao.com> | 2013-07-10 19:11:43 +0800 |
commit | ce18b50d5ff37dc5c558d0602321a61887dd8b48 (patch) | |
tree | a699024c63b8418de34cbe7ba9c6b72ec4388db8 /core/src/hadoop2-yarn/scala | |
parent | aaa7b081df760a29ce5cdcd51d6b71422cba68d5 (diff) | |
download | spark-ce18b50d5ff37dc5c558d0602321a61887dd8b48.tar.gz spark-ce18b50d5ff37dc5c558d0602321a61887dd8b48.tar.bz2 spark-ce18b50d5ff37dc5c558d0602321a61887dd8b48.zip |
set SUCCEEDED for all master in shutdown hook
Diffstat (limited to 'core/src/hadoop2-yarn/scala')
-rw-r--r-- | core/src/hadoop2-yarn/scala/spark/deploy/yarn/ApplicationMaster.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/hadoop2-yarn/scala/spark/deploy/yarn/ApplicationMaster.scala b/core/src/hadoop2-yarn/scala/spark/deploy/yarn/ApplicationMaster.scala index 776db201f9..68bb36d316 100644 --- a/core/src/hadoop2-yarn/scala/spark/deploy/yarn/ApplicationMaster.scala +++ b/core/src/hadoop2-yarn/scala/spark/deploy/yarn/ApplicationMaster.scala @@ -135,6 +135,9 @@ class ApplicationMaster(args: ApplicationMasterArguments, conf: Configuration) e var mainArgs: Array[String] = new Array[String](args.userArgs.size()) args.userArgs.copyToArray(mainArgs, 0, args.userArgs.size()) mainMethod.invoke(null, mainArgs) + // some job script has "System.exit(0)" at the end, for example SparkPi, SparkLR + // userThread will stop here unless it has uncaught exception thrown out + // It need shutdown hook to set SUCCEEDED successed = true } finally { if(successed){ @@ -308,11 +311,8 @@ object ApplicationMaster { logInfo("Invoking sc stop from shutdown hook") sc.stop() // best case ... - // due to the sparkContext is stopped and ApplicationMaster is down, - // the status of registered masters should be set KILLED better than FAILED. - // need discussion for (master <- applicationMasters) { - master.finishApplicationMaster(FinalApplicationStatus.KILLED) + master.finishApplicationMaster(FinalApplicationStatus.SUCCEEDED) } } } ) |