abdullah alamoudi has submitted this change and it was merged. Change subject: [NO ISSUE][STO] Notify of completion of IO request in finally ......................................................................
[NO ISSUE][STO] Notify of completion of IO request in finally - user model changes: no - storage format changes: no - interface changes: no Details: - Notify completion of a request in a finally clause to ensure waiting thread is always notified. Change-Id: I8b3003b47b6b181856faf82aca6e828ee014527c Reviewed-on: https://asterix-gerrit.ics.uci.edu/2839 Sonar-Qube: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> Reviewed-by: Michael Blow <[email protected]> Tested-by: Jenkins <[email protected]> Contrib: Jenkins <[email protected]> --- M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IoRequest.java M hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java 2 files changed, 9 insertions(+), 13 deletions(-) Approvals: Anon. E. Moose #1000171: Jenkins: Verified; No violations found; ; Verified Michael Blow: Looks good to me, approved diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IoRequest.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IoRequest.java index 8c81d41..93e38f5 100644 --- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IoRequest.java +++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/io/IoRequest.java @@ -44,7 +44,7 @@ private long offset; private ByteBuffer data; private ByteBuffer[] dataArray; - private HyracksDataException failure; + private Throwable failure; private int read; private int write; private long writes; @@ -133,15 +133,17 @@ state = State.OPERATION_SUCCEEDED; } catch (Throwable th) { // NOSONAR: This method must never throw anything state = State.OPERATION_FAILED; - failure = HyracksDataException.create(th); + failure = th; + } finally { + notifyAll(); } - notifyAll(); } public State getState() { return state; } + @SuppressWarnings("squid:S899") // Offer failing means we're over capacity and this should be garbage collected void recycle() { reset(); freeRequests.offer(this); @@ -165,6 +167,6 @@ } public HyracksDataException getFailure() { - return failure; + return HyracksDataException.create(failure); } } diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java index 3eea0a9..8e2ff01 100644 --- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java +++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java @@ -142,9 +142,7 @@ } entranceSuccessful = numEntered == components.size(); } catch (Throwable e) { // NOSONAR: Log and re-throw - if (LOGGER.isErrorEnabled()) { - LOGGER.log(Level.ERROR, opType.name() + " failed to enter components on " + lsmIndex, e); - } + LOGGER.warn("{} failed to enter components on {}", opType.name(), lsmIndex, e); throw e; } finally { if (!entranceSuccessful) { @@ -201,9 +199,7 @@ ctx.setAccessingComponents(false); exitOperation(ctx, opType, newComponent, failedOperation); } catch (Throwable e) { // NOSONAR: Log and re-throw - if (LOGGER.isErrorEnabled()) { - LOGGER.log(Level.ERROR, e.getMessage(), e); - } + LOGGER.warn("Failure exiting components", e); throw e; } finally { if (failedOperation && (opType == LSMOperationType.MODIFICATION @@ -710,9 +706,7 @@ processor.finish(); } } catch (HyracksDataException e) { - if (LOGGER.isErrorEnabled()) { - LOGGER.log(Level.ERROR, "Failed to process frame", e); - } + LOGGER.warn("Failed to process frame", e); throw e; } finally { exit(ctx); -- To view, visit https://asterix-gerrit.ics.uci.edu/2839 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8b3003b47b6b181856faf82aca6e828ee014527c Gerrit-PatchSet: 8 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: abdullah alamoudi <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]>
