This is an automated email from the ASF dual-hosted git repository. imaxon pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit dec84265a802476cf31d25d374cfd6511e0016c7 Author: Michael Blow <[email protected]> AuthorDate: Sun May 16 09:24:27 2021 -0400 [NO ISSUE][MISC] Preserve Error instances on retryUntilSuccessOrExhausted 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 <[email protected]> Reviewed-by: Michael Blow <[email protected]> Reviewed-by: Hussain Towaileb <[email protected]> Tested-by: Jenkins <[email protected]> --- .../src/main/java/org/apache/hyracks/api/util/InvokeUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java index 0b1c5a6..7d04cf2 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java @@ -280,6 +280,9 @@ public class InvokeUtil { 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);
