Michael Blow has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/2095
Change subject: [NO ISSUE][HYR] Don't suppress errors, check interrupted exceptions ...................................................................... [NO ISSUE][HYR] Don't suppress errors, check interrupted exceptions Avoid suppressing instances of Error into a HyracksDataException, instead rethrow it. Check when suppressing an InterruptedException that the calling thread is itself interrupted, otherwise emit a warning Change-Id: I9784a18aaaed93e16078437b1cff5006e2a33861 --- M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksDataException.java 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/95/2095/1 diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksDataException.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksDataException.java index 2cf804e..fb23d85 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksDataException.java +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/HyracksDataException.java @@ -59,6 +59,13 @@ if (root == null) { return HyracksDataException.create(th); } + if (th instanceof Error) { + // don't suppress errors into a HyracksDataException, allow them to propagate + throw (Error) th; + } else if (th instanceof InterruptedException && !Thread.currentThread().isInterrupted()) { + LOGGER.log(Level.WARNING, "Suppressing an InterruptedException in a HyracksDataException and current " + + "thread is not interrupted", th); + } root.addSuppressed(th); return root; } -- To view, visit https://asterix-gerrit.ics.uci.edu/2095 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9784a18aaaed93e16078437b1cff5006e2a33861 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Michael Blow <mb...@apache.org>