From notifications-return-2694-archive-asf-public=cust-asf.ponee.io@fluo.apache.org Tue Feb 20 16:59:37 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 684D2180654 for ; Tue, 20 Feb 2018 16:59:37 +0100 (CET) Received: (qmail 68321 invoked by uid 500); 20 Feb 2018 15:59:36 -0000 Mailing-List: contact notifications-help@fluo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@fluo.apache.org Delivered-To: mailing list notifications@fluo.apache.org Received: (qmail 68311 invoked by uid 99); 20 Feb 2018 15:59:36 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2018 15:59:36 +0000 From: GitBox To: notifications@fluo.apache.org Subject: [GitHub] keith-turner closed pull request #1014: Improve async exception handling and quiet test Message-ID: <151914237587.13861.10261595239027611553.gitbox@gitbox.apache.org> keith-turner closed pull request #1014: Improve async exception handling and quiet test URL: https://github.com/apache/fluo/pull/1014 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java index f4ebacfa..d7a541fc 100644 --- a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java +++ b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java @@ -84,6 +84,8 @@ import org.apache.fluo.core.util.Hex; import org.apache.fluo.core.util.SpanUtil; import org.apache.fluo.core.util.UtilWaitThread; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.apache.fluo.accumulo.util.ColumnConstants.PREFIX_MASK; import static org.apache.fluo.accumulo.util.ColumnConstants.RLOCK_PREFIX; @@ -1164,7 +1166,7 @@ public boolean commitPrimaryColumn(CommitData cd, Stamp commitStamp) { .andThen(new CommittedTestStep()); firstStep.compose(cd).exceptionally(throwable -> { - cd.commitObserver.failed(throwable); + setFailed(cd, throwable); return null; }); sco.waitForCommit(); @@ -1331,6 +1333,8 @@ public boolean processResults(CommitData cd, Iterator results) throws Ex @VisibleForTesting public boolean finishCommit(CommitData cd, Stamp commitStamp) { + cd.commitObserver = new SyncCommitObserver(); + getStats().setCommitTs(commitStamp.getTxTimestamp()); CommitStep firstStep = new DeleteLocksStep(); @@ -1481,6 +1485,16 @@ private CommitData setUpBeginCommitAsync(CommitData cd, AsyncCommitObserver comm return cd; } + private void setFailed(CommitData cd, Throwable throwable) { + try { + cd.commitObserver.failed(throwable); + } catch (RuntimeException e) { + Logger log = LoggerFactory.getLogger(TransactionImpl.class); + log.error("Failed to set tx failure (startTs=" + startTs + ") cause ", e); + log.error("Failed to set tx failure (startTs=" + startTs + ") lost throwable ", throwable); + } + } + private void beginCommitAsync(CommitData cd) { // Notification are written between GetCommitStampStep and CommitPrimaryStep for the following @@ -1505,7 +1519,7 @@ private void beginCommitAsync(CommitData cd) { .andThen(new DeleteLocksStep()).andThen(new FinishCommitStep()); firstStep.compose(cd).exceptionally(throwable -> { - cd.commitObserver.failed(throwable); + setFailed(cd, throwable); return null; }); } @@ -1517,7 +1531,7 @@ private void beginCommitAsyncTest(CommitData cd) { firstStep.andThen(new LockOtherStep()).andThen(new CommittedTestStep()); firstStep.compose(cd).exceptionally(throwable -> { - cd.commitObserver.failed(throwable); + setFailed(cd, throwable); return null; }); } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services