Repository: spark
Updated Branches:
  refs/heads/master cbd11d235 -> fe1c895e1


[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 <[email protected]>

Closes #16459 from shimingfei/fixLauncher.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/fe1c895e
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/fe1c895e
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/fe1c895e

Branch: refs/heads/master
Commit: fe1c895e16c475a6f271ce600a42a8d0dc7986e5
Parents: cbd11d2
Author: mingfei <[email protected]>
Authored: Wed Jan 4 10:27:51 2017 +0000
Committer: Sean Owen <[email protected]>
Committed: Wed Jan 4 10:27:51 2017 +0000

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/deploy/yarn/Client.scala    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/fe1c895e/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
----------------------------------------------------------------------
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 be419ce..b212b0e 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 =>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to