SteNicholas commented on a change in pull request #2110:
URL: https://github.com/apache/incubator-kyuubi/pull/2110#discussion_r825273495
##########
File path:
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/spark/SparkProcessBuilder.scala
##########
@@ -195,20 +198,20 @@ class SparkProcessBuilder(
override def killApplication(line: String =
lastRowsOfLog.toArray.mkString("\n")): String =
YARN_APP_NAME_REGEX.findFirstIn(line) match {
case Some(appId) =>
- env.get(KyuubiConf.KYUUBI_HOME) match {
- case Some(kyuubiHome) =>
- val pb = new ProcessBuilder("/bin/sh",
s"$kyuubiHome/bin/stop-application.sh", appId)
- pb.environment()
- .putAll(childProcEnv.asJava)
- pb.redirectError(Redirect.appendTo(engineLog))
- pb.redirectOutput(Redirect.appendTo(engineLog))
- val process = pb.start()
- process.waitFor() match {
- case id if id != 0 => s"Failed to kill Application $appId,
please kill it manually. "
- case _ => s"Killed Application $appId successfully. "
- }
- case None =>
- s"KYUUBI_HOME is not set! Failed to kill Application $appId,
please kill it manually."
+ 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, Caused by ${e.getMessage}."
Review comment:
Adds the `Please kill it manually.` in the message.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]