This is an automated email from the ASF dual-hosted git repository.

pan3793 pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.x by this push:
     new d7cc20d8c0e7 [SPARK-57209][YARN] Log application ID once is assigned
d7cc20d8c0e7 is described below

commit d7cc20d8c0e75233c61976e7b716005409b18f3e
Author: Cheng Pan <[email protected]>
AuthorDate: Wed Jun 3 13:55:47 2026 +0800

    [SPARK-57209][YARN] Log application ID once is assigned
    
    ### What changes were proposed in this pull request?
    
    Log the application ID once is assigned.
    
    ### Why are the changes needed?
    
    When submitting a Spark app to YARN, if it fails to create the staging dir 
(common reason: the user neither has a home dir `/user/foo`, nor has permission 
of the parent dir `/user` to create it), then the app submission fails without 
knowing the app ID from the spark-submit log, though the app ID has been 
assigned.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Log only change, review.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #56268 from pan3793/SPARK-57209.
    
    Authored-by: Cheng Pan <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit 9a57837e89bc802c3994def4d4ff94afff764529)
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala        | 1 +
 1 file changed, 1 insertion(+)

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 fd85bb7ed797..5f25b0b55338 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
@@ -208,6 +208,7 @@ private[spark] class Client(
       val newApp = yarnClient.createApplication()
       val newAppResponse = newApp.getNewApplicationResponse()
       this.appId = newAppResponse.getApplicationId()
+      logInfo(log"Application ID is assigned: ${MDC(LogKeys.APP_ID, appId)}")
 
       // The app staging dir based on the STAGING_DIR configuration if 
configured
       // otherwise based on the users home directory.


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

Reply via email to