You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2021/05/16 13:25:18 UTC

Change in asterixdb[cheshire-cat]: [NO ISSUE][MISC] Preserve Error instances on retryUntilSuccessOrExhau...

From Michael Blow <mb...@apache.org>:

Michael Blow has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11483 )


Change subject: [NO ISSUE][MISC] Preserve Error instances on retryUntilSuccessOrExhausted
......................................................................

[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
---
M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/83/11483/1

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..4d327eb 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 @@
                     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);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11483
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: cheshire-cat
Gerrit-Change-Id: Idfe1d443addaed342b0c0ed3a0a3835ad226dbe7
Gerrit-Change-Number: 11483
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-MessageType: newchange

Change in asterixdb[cheshire-cat]: [NO ISSUE][MISC] Preserve Error instances on retryUntilSuccessOrExhau...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Hussain Towaileb <hu...@gmail.com>:

Hussain Towaileb has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11483 )

Change subject: [NO ISSUE][MISC] Preserve Error instances on retryUntilSuccessOrExhausted
......................................................................


Patch Set 2: Code-Review+2


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11483
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: cheshire-cat
Gerrit-Change-Id: Idfe1d443addaed342b0c0ed3a0a3835ad226dbe7
Gerrit-Change-Number: 11483
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Ali Alsuliman <al...@gmail.com>
Gerrit-Reviewer: Hussain Towaileb <hu...@gmail.com>
Gerrit-Reviewer: Ian Maxon <im...@uci.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Comment-Date: Sun, 16 May 2021 15:34:32 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Change in asterixdb[cheshire-cat]: [NO ISSUE][MISC] Preserve Error instances on retryUntilSuccessOrExhau...

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Michael Blow <mb...@apache.org>:

Michael Blow has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11483 )


Change subject: [NO ISSUE][MISC] Preserve Error instances on retryUntilSuccessOrExhausted
......................................................................

[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
---
M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/83/11483/1

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..4d327eb 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 @@
                     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);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11483
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: cheshire-cat
Gerrit-Change-Id: Idfe1d443addaed342b0c0ed3a0a3835ad226dbe7
Gerrit-Change-Number: 11483
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-MessageType: newchange