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-1452 Cancel cache operations on node stop
Date Wed, 16 Sep 2015 06:15:29 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1452 [created] 9ba0b222c


ignite-1452 Cancel cache operations on node stop


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

Branch: refs/heads/ignite-1452
Commit: 9ba0b222c996fafe73b615fe3f12d9636799808d
Parents: d928ef4
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Sep 16 09:15:12 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Sep 16 09:15:12 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMvccManager.java  | 25 ++++++++++++++++----
 .../IgniteCacheQueryNodeRestartSelfTest2.java   |  2 --
 2 files changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9ba0b222/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
index 555bbda..c04b401 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
@@ -326,7 +326,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
      * Cancels all client futures.
      */
     public void cancelClientFutures() {
-        cancelClientFutures(new IgniteCheckedException("Operation has been cancelled (node
is stopping)."));
+        cancelClientFutures(stopError());
     }
 
     /** {@inheritDoc} */
@@ -362,6 +362,13 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
     }
 
     /**
+     * @return Node stop exception.
+     */
+    private IgniteCheckedException stopError() {
+        return new IgniteCheckedException("Operation has been cancelled (node is stopping).");
+    }
+
+    /**
      * @param from From version.
      * @return To version.
      */
@@ -385,8 +392,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
 
         assert old == null : "Old future is not null [futVer=" + futVer + ", fut=" + fut
+ ", old=" + old + ']';
 
-        if (cctx.kernalContext().clientDisconnected())
-            ((GridFutureAdapter)fut).onDone(disconnectedError(null));
+        onFutureAdded(fut);
     }
 
     /**
@@ -507,8 +513,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
                 fut.onNodeLeft(n.id());
         }
 
-        if (cctx.kernalContext().clientDisconnected())
-            ((GridFutureAdapter)fut).onDone(disconnectedError(null));
+        onFutureAdded(fut);
 
         // Just in case if future was completed before it was added.
         if (fut.isDone())
@@ -518,6 +523,16 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter
{
     }
 
     /**
+     * @param fut Future.
+     */
+    private void onFutureAdded(IgniteInternalFuture<?> fut) {
+        if (cctx.kernalContext().isStopping())
+            ((GridFutureAdapter)fut).onDone(stopError());
+        else if (cctx.kernalContext().clientDisconnected())
+            ((GridFutureAdapter)fut).onDone(disconnectedError(null));
+    }
+
+    /**
      * @param fut Future to remove.
      * @return {@code True} if removed.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/9ba0b222/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
index 1276405..e00611b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
@@ -185,8 +185,6 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
      * @throws Exception If failed.
      */
     public void testRestarts() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-1452");
-
         int duration = 90 * 1000;
         int qryThreadNum = 4;
         int restartThreadsNum = 2; // 4 + 2 = 6 nodes


Mime
View raw message