Repository: spark Updated Branches: refs/heads/master 678c4da0f -> 8aa5aea7f
[SPARK-7236] [CORE] Fix to prevent AkkaUtils askWithReply from sleeping on final attempt Added a check so that if `AkkaUtils.askWithReply` is on the final attempt, it will not sleep for the `retryInterval`. This should also prevent the thread from sleeping for `Int.Max` when using `askWithReply` with default values for `maxAttempts` and `retryInterval`. Author: Bryan Cutler <bjcut...@us.ibm.com> Closes #5896 from BryanCutler/askWithReply-sleep-7236 and squashes the following commits: 653a07b [Bryan Cutler] [SPARK-7236] Fix to prevent AkkaUtils askWithReply from sleeping on final attempt Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/8aa5aea7 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/8aa5aea7 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/8aa5aea7 Branch: refs/heads/master Commit: 8aa5aea7fee0ae9cd34e16c30655ee02b8747455 Parents: 678c4da Author: Bryan Cutler <bjcut...@us.ibm.com> Authored: Mon May 4 18:29:22 2015 -0700 Committer: Reynold Xin <r...@databricks.com> Committed: Mon May 4 18:29:22 2015 -0700 ---------------------------------------------------------------------- core/src/main/scala/org/apache/spark/util/AkkaUtils.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/8aa5aea7/core/src/main/scala/org/apache/spark/util/AkkaUtils.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/org/apache/spark/util/AkkaUtils.scala b/core/src/main/scala/org/apache/spark/util/AkkaUtils.scala index b725df3..de3316d 100644 --- a/core/src/main/scala/org/apache/spark/util/AkkaUtils.scala +++ b/core/src/main/scala/org/apache/spark/util/AkkaUtils.scala @@ -183,7 +183,9 @@ private[spark] object AkkaUtils extends Logging { lastException = e logWarning(s"Error sending message [message = $message] in $attempts attempts", e) } - Thread.sleep(retryInterval) + if (attempts < maxAttempts) { + Thread.sleep(retryInterval) + } } throw new SparkException( --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org