[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.
This commit is contained in:
parent
cbd11d2357
commit
fe1c895e16
|
@ -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 =>
|
||||
|
|
Loading…
Reference in a new issue