ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [09/18] incubator-ignite git commit: fix
Date Thu, 16 Jul 2015 13:51:04 GMT
fix


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

Branch: refs/heads/master
Commit: dda77273b382fbafb96f3710beb514451189e4c5
Parents: cddbed5
Author: Denis Magda <dmagda@gridgain.com>
Authored: Mon Jul 13 19:08:11 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Mon Jul 13 19:08:11 2015 +0300

----------------------------------------------------------------------
 .../communication/tcp/TcpCommunicationSpi.java  |  7 +-
 .../tcp/TcpDiscoveryMultiThreadedTest.java      | 77 ++------------------
 2 files changed, 9 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dda77273/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index f62cdd4..dcc7037 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -2066,7 +2066,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                         client = null;
                     }
 
-                    onException("Handshake timedout (will retry with increased timeout) [timeout="
+ connTimeout0 +
+                    onException("Handshake timeout (will retry with increased timeout) [timeout="
+ connTimeout0 +
                         ", addr=" + addr + ']', e);
 
                     if (log.isDebugEnabled())
@@ -2100,8 +2100,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                     }
                 }
                 catch (Exception e) {
-                    if (!getSpiContext().localNode().isClient() && node.isClient())
-                        getSpiContext().tryFailNode(node.id(), "Killing client");
+                    if (X.hasCause(e, HandshakeFailureException.class) && node.isClient()
&&
+                        !getSpiContext().isStopping())
+                        getSpiContext().tryFailNode(node.id(), "Killing client: " + e.getMessage());
 
                     if (client != null) {
                         client.forceClose();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dda77273/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
index 169a8b5..61fe95d 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
@@ -37,10 +37,10 @@ import static org.apache.ignite.events.EventType.*;
  */
 public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest {
     /** */
-    private static final int GRID_CNT = 4;
+    private static final int GRID_CNT = 5;
 
     /** */
-    private static final int CLIENT_GRID_CNT = 1;
+    private static final int CLIENT_GRID_CNT = 5;
 
     /** */
     private static final ThreadLocal<Boolean> clientFlagPerThread = new ThreadLocal<>();
@@ -102,7 +102,9 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest
{
      * @throws Exception If any error occurs.
      */
     public void testMultiThreaded() throws Exception {
-        execute2();
+        //fail("https://issues.apache.org/jira/browse/IGNITE-1100");
+
+        execute();
     }
 
     /**
@@ -164,75 +166,6 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest
{
     /**
      * @throws Exception If failed.
      */
-    private void execute2() throws Exception {
-        info("Test timeout: " + (getTestTimeout() / (60 * 1000)) + " min.");
-
-        startGridsMultiThreaded(GRID_CNT);
-
-        clientFlagGlobal = true;
-
-        startGridsMultiThreaded(GRID_CNT, CLIENT_GRID_CNT);
-
-        final AtomicBoolean done = new AtomicBoolean();
-
-        final AtomicInteger clientIdx = new AtomicInteger(GRID_CNT);
-
-        IgniteInternalFuture<?> fut1 = multithreadedAsync(
-            new Callable<Object>() {
-                @Override public Object call() throws Exception {
-                    clientFlagPerThread.set(true);
-
-                    int idx = clientIdx.getAndIncrement();
-
-                    while (!done.get()) {
-                        stopGrid(idx);
-                        //assertTrue(stopGrid(idx, true));
-                        startGrid(idx);
-                    }
-
-                    return null;
-                }
-            },
-            1
-        );
-
-        final BlockingQueue<Integer> srvIdx = new LinkedBlockingQueue<>();
-
-        for (int i = 0; i < GRID_CNT; i++)
-            srvIdx.add(i);
-
-        IgniteInternalFuture<?> fut2 = multithreadedAsync(
-            new Callable<Object>() {
-                @Override public Object call() throws Exception {
-                    clientFlagPerThread.set(false);
-
-                    while (!done.get()) {
-                        int idx = srvIdx.take();
-
-                        stopGrid(idx);
-                        //assertTrue(stopGrid(idx, true));
-                        startGrid(idx);
-
-                        srvIdx.add(idx);
-                    }
-
-                    return null;
-                }
-            },
-            GRID_CNT - 1
-        );
-
-        Thread.sleep(getTestTimeout() - 60 * 1000);
-
-        done.set(true);
-
-        fut1.get();
-        fut2.get();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     private void execute() throws Exception {
         info("Test timeout: " + (getTestTimeout() / (60 * 1000)) + " min.");
 


Mime
View raw message