ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-6181
Date Thu, 21 Sep 2017 11:36:09 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-6181-2 433dadbde -> 08ad1c403


ignite-6181


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/08ad1c40
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/08ad1c40
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/08ad1c40

Branch: refs/heads/ignite-6181-2
Commit: 08ad1c40343bef91e36c9383b685bf61a3fb5ab7
Parents: 433dadb
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Sep 21 14:17:22 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Sep 21 14:35:52 2017 +0300

----------------------------------------------------------------------
 .../colocated/GridDhtColocatedLockFuture.java   | 11 ++++----
 .../distributed/near/GridNearLockFuture.java    | 11 ++++----
 .../cache/distributed/near/GridNearTxLocal.java | 27 ++++++++++----------
 .../transactions/TxRollbackOnTimeoutTest.java   |  6 ++---
 4 files changed, 29 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/08ad1c40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index b3f4c0d..5f6ad03 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -570,13 +570,14 @@ public final class GridDhtColocatedLockFuture extends GridCacheCompoundIdentityF
         if (!success)
             undoLocks(distribute, true);
 
-        if (tx != null)
+        if (tx != null) {
             cctx.tm().txContext(tx);
 
-        if (restoreTimeout && tx != null && tx.trackTimeout()) {
-            // Need restore timeout before onDone is called, but onComplete can be called
concurrently,
-            // thus need ignore duplicated timeout objects.
-            tx.addTimeoutHandler(true);
+            if (restoreTimeout && tx.trackTimeout()) {
+                // Need restore timeout before onDone is called, but onComplete can be called
concurrently,
+                // thus need ignore duplicated timeout objects.
+                tx.addTimeoutHandler(true);
+            }
         }
 
         if (super.onDone(success, err)) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/08ad1c40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index c999351..652e6e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -704,13 +704,14 @@ public final class GridNearLockFuture extends GridCacheCompoundIdentityFuture<Bo
         if (!success)
             undoLocks(distribute, true);
 
-        if (tx != null)
+        if (tx != null) {
             cctx.tm().txContext(tx);
 
-        if (restoreTimeout && tx != null && tx.trackTimeout()) {
-            // Need restore timeout before onDone is called, but onComplete can be called
concurrently,
-            // thus need ignore duplicated timeout objects.
-            tx.addTimeoutHandler(true);
+            if (restoreTimeout && tx.trackTimeout()) {
+                // Need restore timeout before onDone is called, but onComplete can be called
concurrently,
+                // thus need ignore duplicated timeout objects.
+                tx.addTimeoutHandler(true);
+            }
         }
 
         if (super.onDone(success, err)) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/08ad1c40/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index f6fa729..ecbacf9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -3224,21 +3224,22 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter implements
GridTimeou
 
                 return rollbackFut;
             }
+            else {
+                final GridFutureAdapter<IgniteInternalTx> fut0 = new GridFutureAdapter<>();
 
-            final GridFutureAdapter<IgniteInternalTx> fut0 = new GridFutureAdapter<>();
-
-            fut.listen(new IgniteInClosure<IgniteInternalFuture<IgniteInternalTx>>()
{
-                @Override public void apply(IgniteInternalFuture<IgniteInternalTx>
fut) {
-                    if (timedOut())
-                        fut0.onDone(new IgniteTxTimeoutCheckedException("Failed to commit
transaction, " +
-                            "transaction is concurrently rolled back on timeout: " + tx));
-                    else
-                        fut0.onDone(new IgniteCheckedException("Failed to commit transaction,
" +
-                            "transaction is concurrently rolled back: " + tx));
-                }
-            });
+                fut.listen(new IgniteInClosure<IgniteInternalFuture<IgniteInternalTx>>()
{
+                    @Override public void apply(IgniteInternalFuture<IgniteInternalTx>
fut) {
+                        if (timedOut())
+                            fut0.onDone(new IgniteTxTimeoutCheckedException("Failed to commit
transaction, " +
+                                "transaction is concurrently rolled back on timeout: " +
tx));
+                        else
+                            fut0.onDone(new IgniteCheckedException("Failed to commit transaction,
" +
+                                "transaction is concurrently rolled back: " + tx));
+                    }
+                });
 
-            return fut0;
+                return fut0;
+            }
         }
 
         return fut;

http://git-wip-us.apache.org/repos/asf/ignite/blob/08ad1c40/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java
index fbb232b..16462b8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache.transactions;
 
+import java.util.Collection;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ThreadLocalRandom;
 import javax.cache.CacheException;
@@ -30,7 +31,6 @@ import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
-import org.apache.ignite.internal.util.GridConcurrentSkipListSet;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.G;
 import org.apache.ignite.internal.util.typedef.X;
@@ -475,13 +475,13 @@ public class TxRollbackOnTimeoutTest extends GridCommonAbstractTest
{
             saved = t;
         }
 
-        GridConcurrentSkipListSet set = U.field(near.context().cache().context().time(),
"timeoutObjs");
+        Collection set = U.field(near.context().cache().context().time(), "timeoutObjs");
 
         for (Object obj : set) {
             if (obj.getClass().isAssignableFrom(GridNearTxLocal.class)) {
                 log.error("Last saved exception: " + saved, saved);
 
-                fail("Not remove for mode=" + mode + " and timeout=" + timeout);
+                fail("Not removed [mode=" + mode + ", timeout=" + timeout + ", tx=" + obj
+']');
             }
         }
     }


Mime
View raw message