aboutsummaryrefslogtreecommitdiff
path: root/resource-managers
diff options
context:
space:
mode:
authormingfei <mingfei.smf@alipay.com>2017-01-04 10:27:51 +0000
committerSean Owen <sowen@cloudera.com>2017-01-04 10:27:51 +0000
commitfe1c895e16c475a6f271ce600a42a8d0dc7986e5 (patch)
treee7a11680db83c2ff2a491204fff05a2956657235 /resource-managers
parentcbd11d235752d0ab30cfdbf2351cb3e68a123606 (diff)
downloadspark-fe1c895e16c475a6f271ce600a42a8d0dc7986e5.tar.gz
spark-fe1c895e16c475a6f271ce600a42a8d0dc7986e5.tar.bz2
spark-fe1c895e16c475a6f271ce600a42a8d0dc7986e5.zip
[SPARK-19073] LauncherState should be only set to SUBMITTED after the application is submitted
## What changes were proposed in this pull request? LauncherState should be only set to SUBMITTED after the application is submitted. Currently the state is set before the application is actually submitted. ## How was this patch tested? no test is added in this patch Author: mingfei <mingfei.smf@alipay.com> Closes #16459 from shimingfei/fixLauncher.
Diffstat (limited to 'resource-managers')
-rw-r--r--resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala b/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
index be419cee77..b212b0eaaf 100644
--- a/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
+++ b/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
@@ -158,8 +158,6 @@ private[spark] class Client(
val newApp = yarnClient.createApplication()
val newAppResponse = newApp.getNewApplicationResponse()
appId = newAppResponse.getApplicationId()
- reportLauncherState(SparkAppHandle.State.SUBMITTED)
- launcherBackend.setAppId(appId.toString)
new CallerContext("CLIENT", sparkConf.get(APP_CALLER_CONTEXT),
Option(appId.toString)).setCurrentContext()
@@ -174,6 +172,9 @@ private[spark] class Client(
// Finally, submit and monitor the application
logInfo(s"Submitting application $appId to ResourceManager")
yarnClient.submitApplication(appContext)
+ launcherBackend.setAppId(appId.toString)
+ reportLauncherState(SparkAppHandle.State.SUBMITTED)
+
appId
} catch {
case e: Throwable =>