Skip to content
Snippets Groups Projects
Unverified Commit fe1c895e authored by mingfei's avatar mingfei Committed by Sean Owen
Browse files

[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.
parent cbd11d23
No related branches found
No related tags found
No related merge requests found
...@@ -158,8 +158,6 @@ private[spark] class Client( ...@@ -158,8 +158,6 @@ private[spark] class Client(
val newApp = yarnClient.createApplication() val newApp = yarnClient.createApplication()
val newAppResponse = newApp.getNewApplicationResponse() val newAppResponse = newApp.getNewApplicationResponse()
appId = newAppResponse.getApplicationId() appId = newAppResponse.getApplicationId()
reportLauncherState(SparkAppHandle.State.SUBMITTED)
launcherBackend.setAppId(appId.toString)
new CallerContext("CLIENT", sparkConf.get(APP_CALLER_CONTEXT), new CallerContext("CLIENT", sparkConf.get(APP_CALLER_CONTEXT),
Option(appId.toString)).setCurrentContext() Option(appId.toString)).setCurrentContext()
...@@ -174,6 +172,9 @@ private[spark] class Client( ...@@ -174,6 +172,9 @@ private[spark] class Client(
// Finally, submit and monitor the application // Finally, submit and monitor the application
logInfo(s"Submitting application $appId to ResourceManager") logInfo(s"Submitting application $appId to ResourceManager")
yarnClient.submitApplication(appContext) yarnClient.submitApplication(appContext)
launcherBackend.setAppId(appId.toString)
reportLauncherState(SparkAppHandle.State.SUBMITTED)
appId appId
} catch { } catch {
case e: Throwable => case e: Throwable =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment