Skip to content

Commit 8aa5aea

Browse files
BryanCutlerrxin
authored andcommitted
[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 <[email protected]> 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
1 parent 678c4da commit 8aa5aea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/scala/org/apache/spark/util/AkkaUtils.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ private[spark] object AkkaUtils extends Logging {
183183
lastException = e
184184
logWarning(s"Error sending message [message = $message] in $attempts attempts", e)
185185
}
186-
Thread.sleep(retryInterval)
186+
if (attempts < maxAttempts) {
187+
Thread.sleep(retryInterval)
188+
}
187189
}
188190

189191
throw new SparkException(

0 commit comments

Comments
 (0)