Skip to content
Snippets Groups Projects
Commit 8aa5aea7 authored by Bryan Cutler's avatar Bryan Cutler Committed by Reynold Xin
Browse files

[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 <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
parent 678c4da0
No related merge requests found
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment