Skip to content
Permalink
Browse files
[NO ISSUE][MISC] Preserve Error instances on retryUntilSuccessOrExhau…
…sted

Prior to this change, InvokeUtil.retryUntilSuccessOrExhausted() would wrap instances of
java.lang.Error with HyracksDataException upon exhaustion of retry attempts.  Errors are
typically handled differently than non-Errors, so preserve the Error when propagating
the failure to the caller.

Change-Id: Idfe1d443addaed342b0c0ed3a0a3835ad226dbe7
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11483
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
Reviewed-by: Hussain Towaileb <hussainht@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
  • Loading branch information
mblow committed May 17, 2021
1 parent 86da3f8 commit dec84265a802476cf31d25d374cfd6511e0016c7
Showing 1 changed file with 3 additions and 0 deletions.
@@ -280,6 +280,9 @@ public static <T> T retryUntilSuccessOrExhausted(Span span, ComputingAction<T> a
long delayMs = delay.calculate(attempt);
if (!policy.retry(th) || span.elapsed() || span.remaining(TimeUnit.MILLISECONDS) < delayMs) {
onFailure.attemptFailed(action, attempt, true, span, failure);
if (th instanceof Error) {
throw (Error) th;
}
throw HyracksDataException.create(failure);
} else {
onFailure.attemptFailed(action, attempt, false, span, failure);

0 comments on commit dec8426

Please sign in to comment.