diff options
author | Matei Zaharia <root@ip-10-226-118-223.ec2.internal> | 2012-10-07 07:25:41 +0000 |
---|---|---|
committer | Matei Zaharia <root@ip-10-226-118-223.ec2.internal> | 2012-10-07 07:25:41 +0000 |
commit | a3bf0ce57f5333ee16c672355bb2431ab72cd44b (patch) | |
tree | a4add263c1a1ae40f5b6573dfaebfe4e60227cce /core | |
parent | eca570f66a3d93bc1745a9fcf8410ad0a9db3e64 (diff) | |
download | spark-a3bf0ce57f5333ee16c672355bb2431ab72cd44b.tar.gz spark-a3bf0ce57f5333ee16c672355bb2431ab72cd44b.tar.bz2 spark-a3bf0ce57f5333ee16c672355bb2431ab72cd44b.zip |
Don't crash on ask timeout exceptions in deploy.Client.stop() (fixes a crash in tests)
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/spark/deploy/client/Client.scala | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/src/main/scala/spark/deploy/client/Client.scala b/core/src/main/scala/spark/deploy/client/Client.scala index b1b72a3a1f..e51b0c5c15 100644 --- a/core/src/main/scala/spark/deploy/client/Client.scala +++ b/core/src/main/scala/spark/deploy/client/Client.scala @@ -4,6 +4,7 @@ import spark.deploy._ import akka.actor._ import akka.pattern.ask import akka.util.duration._ +import akka.pattern.AskTimeoutException import spark.{SparkException, Logging} import akka.remote.RemoteClientLifeCycleEvent import akka.remote.RemoteClientShutdown @@ -100,9 +101,13 @@ private[spark] class Client( def stop() { if (actor != null) { - val timeout = 1.seconds - val future = actor.ask(StopClient)(timeout) - Await.result(future, timeout) + try { + val timeout = 1.seconds + val future = actor.ask(StopClient)(timeout) + Await.result(future, timeout) + } catch { + case e: AskTimeoutException => // Ignore it, maybe master went away + } actor = null } } |