You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/04/11 19:57:45 UTC

[GitHub] [incubator-kyuubi] cxzl25 commented on a diff in pull request #2314: [KYUUBI #2289] Use unique tag to kill applications

cxzl25 commented on code in PR #2314:
URL: https://github.com/apache/incubator-kyuubi/pull/2314#discussion_r847686508


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala:
##########
@@ -193,28 +194,32 @@ class SparkProcessBuilder(
     }
   }
 
-  override def killApplication(line: String = lastRowsOfLog.toArray.mkString("\n")): String =
-    YARN_APP_NAME_REGEX.findFirstIn(line) match {
-      case Some(appId) =>
-        try {
-          val hadoopConf = KyuubiHadoopUtils.newHadoopConf(conf)
-          yarnClient.init(hadoopConf)
-          yarnClient.start()
-          val applicationId = ApplicationId.fromString(appId)
-          yarnClient.killApplication(applicationId)
-          s"Killed Application $appId successfully."
-        } catch {
-          case e: Throwable =>
-            s"Failed to kill Application $appId, please kill it manually." +
-              s" Caused by ${e.getMessage}."
-        } finally {
-          if (yarnClient != null) {
-            yarnClient.stop()
-          }
+  override def killApplication(engineRefId: String): String = {
+    val master = conf.getOption("spark.master").getOrElse("local")

Review Comment:
   In this way, `spark.master` can only be configured in `kyuubi-defaults.conf` to support automatic kill yarn app, but not in `spark-defaults.conf`?
   
   nit:`spark.master` can be used as a constant of `object SparkProcessBuilder`.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org