This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new d19119bae [KYUUBI #6366] Improve log message for YARN
getApplicationInfoByTag
d19119bae is described below
commit d19119bae1683ad43c7c749dfc9592b711471db2
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]>
---
.../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
}
}