Skip to content
Snippets Groups Projects
Commit 202ebf06 authored by linweizhong's avatar linweizhong Committed by Sean Owen
Browse files

[SPARK-6870][Yarn] Catch InterruptedException when yarn application state...

[SPARK-6870][Yarn] Catch InterruptedException when yarn application state monitor thread been interrupted

On PR #5305 we interrupt the monitor thread but forget to catch the InterruptedException, then in the log will print the stack info, so we need to catch it.

Author: linweizhong <linweizhong@huawei.com>

Closes #5479 from Sephiroth-Lin/SPARK-6870 and squashes the following commits:

f775f93 [linweizhong] Update, don't need to call Thread.currentThread() on monitor thread
0e2ef1f [linweizhong] Update
0d8958a [linweizhong] Update
3513fdb [linweizhong] Catch InterruptedException
parent 240ea03f
No related branches found
No related tags found
No related merge requests found
......@@ -128,10 +128,13 @@ private[spark] class YarnClientSchedulerBackend(
assert(client != null && appId != null, "Application has not been submitted yet!")
val t = new Thread {
override def run() {
val (state, _) = client.monitorApplication(appId, logApplicationReport = false)
logError(s"Yarn application has already exited with state $state!")
sc.stop()
Thread.currentThread().interrupt()
try {
val (state, _) = client.monitorApplication(appId, logApplicationReport = false)
logError(s"Yarn application has already exited with state $state!")
sc.stop()
} catch {
case e: InterruptedException => logInfo("Interrupting monitor thread")
}
}
}
t.setName("Yarn application state monitor")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment