aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorzsxwing <zsxwing@gmail.com>2015-07-31 09:34:10 -0700
committerKay Ousterhout <kayousterhout@gmail.com>2015-07-31 09:34:16 -0700
commit04a49edfdb606c01fa4f8ae6e730ec4f9bd0cb6d (patch)
tree1775f1acf4654483722d3308854f5ddd9e676636 /core
parentfc0e57e5aba82a3f227fef05a843283e2ec893fc (diff)
downloadspark-04a49edfdb606c01fa4f8ae6e730ec4f9bd0cb6d.tar.gz
spark-04a49edfdb606c01fa4f8ae6e730ec4f9bd0cb6d.tar.bz2
spark-04a49edfdb606c01fa4f8ae6e730ec4f9bd0cb6d.zip
[SPARK-9497] [SPARK-9509] [CORE] Use ask instead of askWithRetry
`RpcEndpointRef.askWithRetry` throws `SparkException` rather than `TimeoutException`. Use ask to replace it because we don't need to retry here. Author: zsxwing <zsxwing@gmail.com> Closes #7824 from zsxwing/SPARK-9497 and squashes the following commits: 7bfc2b4 [zsxwing] Use ask instead of askWithRetry
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala b/core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala
index 79b251e7e6..a659abf703 100644
--- a/core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/client/AppClient.scala
@@ -27,7 +27,7 @@ import org.apache.spark.deploy.{ApplicationDescription, ExecutorState}
import org.apache.spark.deploy.DeployMessages._
import org.apache.spark.deploy.master.Master
import org.apache.spark.rpc._
-import org.apache.spark.util.{ThreadUtils, Utils}
+import org.apache.spark.util.{RpcUtils, ThreadUtils, Utils}
/**
* Interface allowing applications to speak with a Spark deploy cluster. Takes a master URL,
@@ -248,7 +248,8 @@ private[spark] class AppClient(
def stop() {
if (endpoint != null) {
try {
- endpoint.askWithRetry[Boolean](StopAppClient)
+ val timeout = RpcUtils.askRpcTimeout(conf)
+ timeout.awaitResult(endpoint.ask[Boolean](StopAppClient))
} catch {
case e: TimeoutException =>
logInfo("Stop request to Master timed out; it may already be shut down.")