Repository: spark Updated Branches: refs/heads/branch-1.4 1388a469b -> 48655d10e
[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 (cherry picked from commit 8aa5aea7fee0ae9cd34e16c30655ee02b8747455) Signed-off-by: Reynold Xin <r...@databricks.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/48655d10 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/48655d10 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/48655d10 Branch: refs/heads/branch-1.4 Commit: 48655d10ede9f286140ebe6d72be04b8ea9c3d85 Parents: 1388a46 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:30:02 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/48655d10/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