Repository: spark
Updated Branches:
  refs/heads/master 240ea03fa -> 202ebf06e


[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 <linweizh...@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


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/202ebf06
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/202ebf06
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/202ebf06

Branch: refs/heads/master
Commit: 202ebf06e0f2d5df8b712e604fd95fa58e34ea20
Parents: 240ea03
Author: linweizhong <linweizh...@huawei.com>
Authored: Mon Apr 13 13:06:54 2015 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Mon Apr 13 13:06:54 2015 +0100

----------------------------------------------------------------------
 .../scheduler/cluster/YarnClientSchedulerBackend.scala   | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/202ebf06/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala
----------------------------------------------------------------------
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 407dc1a..99c0532 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")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to