ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: zk
Date Thu, 30 Nov 2017 14:52:38 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-zk 4405bb1cb -> c949c0d4e


zk


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

Branch: refs/heads/ignite-zk
Commit: c949c0d4eca1d67d5f06a05b91e5ed3a2d9fe2ec
Parents: 4405bb1
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Nov 30 17:52:30 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Nov 30 17:52:30 2017 +0300

----------------------------------------------------------------------
 .../discovery/GridDiscoveryManager.java         |  2 +-
 .../zk/internal/ZookeeperDiscoveryImpl.java     |  3 ++
 .../IgniteClientReconnectAbstractTest.java      | 30 ++++++++++++++++----
 .../IgniteClientReconnectComputeTest.java       |  2 +-
 .../testframework/junits/GridAbstractTest.java  | 11 ++++++-
 5 files changed, 39 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c949c0d4/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 1a0712f..a6cc06d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -1673,7 +1673,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
             return getSpi().pingNode(nodeId);
         }
         catch (IgniteException e) {
-            if (e.hasCause(IgniteClientDisconnectedCheckedException.class)) {
+            if (e.hasCause(IgniteClientDisconnectedCheckedException.class, IgniteClientDisconnectedException.class))
{
                 IgniteFuture<?> reconnectFut = ctx.cluster().clientReconnectFuture();
 
                 throw new IgniteClientDisconnectedCheckedException(reconnectFut, e.getMessage());

http://git-wip-us.apache.org/repos/asf/ignite/blob/c949c0d4/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
index 5e806eb..5dc90ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
@@ -1542,6 +1542,9 @@ public class ZookeeperDiscoveryImpl {
     private void onFatalError(GridSpinBusyLock busyLock, Throwable err) {
         busyLock.leaveBusy();
 
+        if (err instanceof ZookeeperClientFailedException)
+            return;
+
         if (connState == ConnectionState.STOPPED)
             return;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c949c0d4/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAbstractTest.java
index fa9cc35..c9a931e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAbstractTest.java
@@ -185,16 +185,28 @@ public abstract class IgniteClientReconnectAbstractTest extends GridCommonAbstra
      * @return Server node client connected to.
      */
     protected Ignite clientRouter(Ignite client) {
-        TcpDiscoveryNode node = (TcpDiscoveryNode)client.cluster().localNode();
+        if (tcpDiscovery()) {
+            TcpDiscoveryNode node = (TcpDiscoveryNode)client.cluster().localNode();
 
-        assertTrue(node.isClient());
-        assertNotNull(node.clientRouterNodeId());
+            assertTrue(node.isClient());
+            assertNotNull(node.clientRouterNodeId());
 
-        Ignite srv = G.ignite(node.clientRouterNodeId());
+            Ignite srv = G.ignite(node.clientRouterNodeId());
 
-        assertNotNull(srv);
+            assertNotNull(srv);
 
-        return srv;
+            return srv;
+        }
+        else {
+            for (Ignite node : G.allGrids()) {
+                if (!node.cluster().localNode().isClient())
+                    return node;
+            }
+
+            fail();
+
+            return null;
+        }
     }
 
     /**
@@ -251,6 +263,12 @@ public abstract class IgniteClientReconnectAbstractTest extends GridCommonAbstra
         List<Ignite> clients, Ignite srv,
         @Nullable Runnable disconnectedC)
         throws Exception {
+        if (!tcpDiscovery()) {
+            reconnectClients(log, clients);
+
+            return;
+        }
+
         final TestTcpDiscoverySpi srvSpi = spi(srv);
 
         final CountDownLatch disconnectLatch = new CountDownLatch(clients.size());

http://git-wip-us.apache.org/repos/asf/ignite/blob/c949c0d4/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectComputeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectComputeTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectComputeTest.java
index cce0c7e..7d34e29 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectComputeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectComputeTest.java
@@ -49,7 +49,7 @@ public class IgniteClientReconnectComputeTest extends IgniteClientReconnectAbstr
 
         assertTrue(client.cluster().localNode().isClient());
 
-        Ignite srv = clientRouter(client);
+        Ignite srv = ignite(0);
 
         IgniteCache<Integer, Integer> cache = client.getOrCreateCache("test-cache");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c949c0d4/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index cdaae76..299ad8b 100755
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -2206,12 +2206,21 @@ public abstract class GridAbstractTest extends TestCase {
      * @throws Exception If failed.
      */
     protected static void reconnectClient(IgniteLogger log, Ignite client) throws Exception
{
+        reconnectClients(log, Collections.singletonList(client));
+    }
+
+    /**
+     * @param log Log.
+     * @param clients Nodes to reconnect.
+     * @throws Exception If failed.
+     */
+    protected static void reconnectClients(IgniteLogger log, List<Ignite> clients)
throws Exception {
         List<Ignite> nodes = G.allGrids();
 
         assertFalse("There are no nodes", nodes.isEmpty());
 
         if (nodes.get(0).configuration().getDiscoverySpi().getClass().getName().equals(ZK_DISCOVERY))
-            ZookeeperDiscoverySpiBasicTest.reconnectClientNodes(log, Collections.singletonList(client),
null, true);
+            ZookeeperDiscoverySpiBasicTest.reconnectClientNodes(log, clients, null, true);
         else
             fail("Reconnect is not supported");
     }


Mime
View raw message