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

chengpan pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new 8bd1f7dd1 [KYUUBI #6366] Improve log message for YARN 
getApplicationInfoByTag
8bd1f7dd1 is described below

commit 8bd1f7dd15555b03703eddcfb350cd117f552b2f
Author: Cheng Pan <[email protected]>
AuthorDate: Wed May 8 11:41:25 2024 +0800

    [KYUUBI #6366] Improve log message for YARN getApplicationInfoByTag
    
    # :mag: Description
    
    Unify the words and provide the tag for the waiting submission case.
    
    ## Types of changes :bookmark:
    
    - [ ] Bugfix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
    
    ## Test Plan ๐Ÿงช
    
    Manually review.
    
    ---
    
    # Checklist ๐Ÿ“
    
    - [x] This patch was not authored or co-authored using [Generative 
Tooling](https://www.apache.org/legal/generative-tooling.html)
    
    **Be nice. Be informative.**
    
    Closes #6366 from pan3793/improve-log.
    
    Closes #6366
    
    30e3fdee0 [Cheng Pan] fix style
    a3b36ea33 [Cheng Pan] Improve log message for YARN getApplicationInfoByTag
    
    Authored-by: Cheng Pan <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit d19119bae1683ad43c7c749dfc9592b711471db2)
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../kyuubi/engine/YarnApplicationOperation.scala   | 23 +++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/YarnApplicationOperation.scala
 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/YarnApplicationOperation.scala
index 18d0006a5..9d6ca32fa 100644
--- 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/YarnApplicationOperation.scala
+++ 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/YarnApplicationOperation.scala
@@ -27,7 +27,7 @@ import org.apache.hadoop.yarn.client.api.YarnClient
 
 import org.apache.kyuubi.{Logging, Utils}
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.config.KyuubiConf.YarnUserStrategy
+import org.apache.kyuubi.config.KyuubiConf.{ENGINE_YARN_SUBMIT_TIMEOUT, 
YarnUserStrategy}
 import org.apache.kyuubi.config.KyuubiConf.YarnUserStrategy._
 import org.apache.kyuubi.engine.ApplicationOperation._
 import org.apache.kyuubi.engine.ApplicationState.ApplicationState
@@ -129,21 +129,22 @@ class YarnApplicationOperation extends 
ApplicationOperation with Logging {
       tag: String,
       proxyUser: Option[String] = None,
       submitTime: Option[Long] = None): ApplicationInfo = 
withYarnClient(proxyUser) { yarnClient =>
-    debug(s"Getting application info from Yarn cluster by $tag tag")
+    debug(s"Getting application info from YARN cluster by tag: $tag")
     val reports = yarnClient.getApplications(null, null, Set(tag).asJava)
     if (reports.isEmpty) {
-      debug(s"Application with tag $tag not found")
+      debug(s"Can't find target application from YARN cluster by tag: $tag")
       submitTime match {
         case Some(_submitTime) =>
           val elapsedTime = System.currentTimeMillis - _submitTime
-          if (elapsedTime > submitTimeout) {
-            error(s"Can't find target yarn application by tag: $tag, " +
-              s"elapsed time: ${elapsedTime}ms exceeds ${submitTimeout}ms.")
-            ApplicationInfo.NOT_FOUND
-          } else {
-            warn("Wait for yarn application to be submitted, " +
-              s"elapsed time: ${elapsedTime}ms, return UNKNOWN status")
+          if (elapsedTime < submitTimeout) {
+            info(s"Wait for YARN application[tag: $tag] to be submitted, " +
+              s"elapsed time: ${elapsedTime}ms, return 
${ApplicationInfo.UNKNOWN} status")
             ApplicationInfo.UNKNOWN
+          } else {
+            error(s"Can't find target application from YARN cluster by tag: 
$tag, " +
+              s"elapsed time: ${elapsedTime}ms exceeds 
${ENGINE_YARN_SUBMIT_TIMEOUT.key}: " +
+              s"${submitTimeout}ms, return ${ApplicationInfo.NOT_FOUND} 
status")
+            ApplicationInfo.NOT_FOUND
           }
         case _ => ApplicationInfo.NOT_FOUND
       }
@@ -158,7 +159,7 @@ class YarnApplicationOperation extends ApplicationOperation 
with Logging {
           report.getFinalApplicationStatus),
         url = Option(report.getTrackingUrl),
         error = Option(report.getDiagnostics))
-      debug(s"Successfully got application info by $tag: $info")
+      debug(s"Successfully got application info by tag: $tag. $info")
       info
     }
   }

Reply via email to