diff options
author | linweizhong <linweizhong@huawei.com> | 2015-04-13 13:06:54 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-04-13 13:06:54 +0100 |
commit | 202ebf06e0f2d5df8b712e604fd95fa58e34ea20 (patch) | |
tree | 7915b456b7673cb6b76cf88b2e1245eb6e91a98a /yarn/src | |
parent | 240ea03faea005306e73c10253716b95487325ff (diff) | |
download | spark-202ebf06e0f2d5df8b712e604fd95fa58e34ea20.tar.gz spark-202ebf06e0f2d5df8b712e604fd95fa58e34ea20.tar.bz2 spark-202ebf06e0f2d5df8b712e604fd95fa58e34ea20.zip |
[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
Diffstat (limited to 'yarn/src')
-rw-r--r-- | yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala b/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala index 407dc1ac4d..99c05329b4 100644 --- a/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala +++ b/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala @@ -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") |