Merge branch ignite-1.5 into ignite-1702
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2da1cc3c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2da1cc3c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2da1cc3c Branch: refs/heads/ignite-1702 Commit: 2da1cc3cd15c0046134dbd31c103d5c32f2e2372 Parents: 2d92ad2 Author: Alexey Goncharuk <[email protected]> Authored: Sun Nov 8 20:12:27 2015 +0300 Committer: Alexey Goncharuk <[email protected]> Committed: Sun Nov 8 20:12:27 2015 +0300 ---------------------------------------------------------------------- .../distributed/dht/GridDhtTxPrepareFuture.java | 36 +++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/2da1cc3c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java index 977b269..cb9ff8a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java @@ -585,13 +585,8 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter if (tx.markFinalizing(IgniteInternalTx.FinalizationStatus.USER_FINISH)) { IgniteInternalFuture<IgniteInternalTx> fut = null; - if (prepErr == null) - fut = tx.commitAsync(); - else if (!cctx.kernalContext().isStopping()) - fut = tx.rollbackAsync(); - - if (fut != null) { - fut.listen(new CIX1<IgniteInternalFuture<IgniteInternalTx>>() { + CIX1<IgniteInternalFuture<IgniteInternalTx>> responseClo = + new CIX1<IgniteInternalFuture<IgniteInternalTx>>() { @Override public void applyx(IgniteInternalFuture<IgniteInternalTx> fut) { try { if (replied.compareAndSet(false, true)) @@ -601,8 +596,33 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter U.error(log, "Failed to send prepare response for transaction: " + tx, e); } } - }); + }; + + if (prepErr == null) { + try { + fut = tx.commitAsync(); + } + catch (RuntimeException | Error e) { + Exception hEx = new IgniteTxHeuristicCheckedException("Commit produced a runtime " + + "exception: " + CU.txString(tx), e); + + res.error(hEx); + + tx.systemInvalidate(true); + + fut = tx.rollbackAsync(); + + fut.listen(responseClo); + + throw e; + } + } + else if (!cctx.kernalContext().isStopping()) + fut = tx.rollbackAsync(); + + if (fut != null) + fut.listen(responseClo); } } else {
