Skip to content

Commit 659eb1c

Browse files
mingfeicmonkey
authored andcommitted
[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 apache#16459 from shimingfei/fixLauncher.
1 parent 2c9d303 commit 659eb1c

File tree

1 file changed

+3
-2
lines changed
  • resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn

1 file changed

+3
-2
lines changed

resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ private[spark] class Client(
158158
val newApp = yarnClient.createApplication()
159159
val newAppResponse = newApp.getNewApplicationResponse()
160160
appId = newAppResponse.getApplicationId()
161-
reportLauncherState(SparkAppHandle.State.SUBMITTED)
162-
launcherBackend.setAppId(appId.toString)
163161

164162
new CallerContext("CLIENT", sparkConf.get(APP_CALLER_CONTEXT),
165163
Option(appId.toString)).setCurrentContext()
@@ -174,6 +172,9 @@ private[spark] class Client(
174172
// Finally, submit and monitor the application
175173
logInfo(s"Submitting application $appId to ResourceManager")
176174
yarnClient.submitApplication(appContext)
175+
launcherBackend.setAppId(appId.toString)
176+
reportLauncherState(SparkAppHandle.State.SUBMITTED)
177+
177178
appId
178179
} catch {
179180
case e: Throwable =>

0 commit comments

Comments
 (0)