You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/09/18 04:44:22 UTC

[GitHub] [incubator-kyuubi] zhang1002 commented on a change in pull request #1119: [KYUUBI #1039] kill yarn job when engine initialize timeout and yarnApplicationState is ACCEPTED

zhang1002 commented on a change in pull request #1119:
URL: https://github.com/apache/incubator-kyuubi/pull/1119#discussion_r711480495



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala
##########
@@ -148,6 +149,38 @@ trait ProcBuilder {
     proc
   }
 
+  def execKillYarnJob(appId: String): Int = {
+    val hadoopHomeOpt = env.get("HADOOP_HOME").orElse {
+      throw KyuubiSQLException(s"Failed to kill yarn job. HADOOP_HOME is not set! " +
+        "For more detail information on installing and configuring Yarn, please visit " +
+        "https://kyuubi.apache.org/docs/stable/deployment/on_yarn.html")
+    }.map { hadoopHome =>
+      Paths.get(hadoopHome, "bin", "yarn").toAbsolutePath.toFile.getCanonicalPath
+    }.get
+    val command = hadoopHomeOpt + " application -kill " + appId
+    val pb = new ProcessBuilder("/bin/sh", "-c", command)
+    var exitValue: Option[Int] = None
+

Review comment:
       we have hadoop-client dependency, keyTab and principle. why we don't use yarn-client to kill this application?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org