Skip to content

Commit

Permalink
[SPARK-7236] [CORE] Fix to prevent AkkaUtils askWithReply from sleepi…
Browse files Browse the repository at this point in the history
…ng 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 <bjcutler@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
  • Loading branch information
BryanCutler authored and rxin committed May 5, 2015
1 parent 678c4da commit 8aa5aea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/scala/org/apache/spark/util/AkkaUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8aa5aea

Please sign in to comment.