ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [4/4] incubator-ignite git commit: ignite-752: bugs fixing
Date Wed, 22 Jul 2015 08:44:00 GMT
ignite-752: bugs fixing


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

Branch: refs/heads/ignite-752
Commit: 8ee7371b5a5e7b54febcaf3c2bb67df99820a685
Parents: e37069d
Author: Denis Magda <dmagda@gridgain.com>
Authored: Wed Jul 22 11:43:37 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Wed Jul 22 11:43:37 2015 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 25 ++++++++++----------
 .../tcp/TcpClientDiscoverySpiSelfTest.java      | 21 +++++++++++-----
 2 files changed, 27 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ee7371b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 03cf3da..1f93feb 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -1648,26 +1648,22 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi,
T
         initFailureDetectionThreshold();
 
         if (!forceSrvMode && (Boolean.TRUE.equals(ignite.configuration().isClientMode())))
{
-            if (!failureDetectionThresholdEnabled()) {
-                if (ackTimeout == 0)
-                    ackTimeout = DFLT_ACK_TIMEOUT_CLIENT;
+            if (ackTimeout == 0)
+                ackTimeout = DFLT_ACK_TIMEOUT_CLIENT;
 
-                if (sockTimeout == 0)
-                    sockTimeout = DFLT_SOCK_TIMEOUT_CLIENT;
-            }
+            if (sockTimeout == 0)
+                sockTimeout = DFLT_SOCK_TIMEOUT_CLIENT;
 
             impl = new ClientImpl(this);
 
             ctxInitLatch.countDown();
         }
         else {
-            if (!failureDetectionThresholdEnabled()) {
-                if (ackTimeout == 0)
-                    ackTimeout = DFLT_ACK_TIMEOUT;
+            if (ackTimeout == 0)
+                ackTimeout = DFLT_ACK_TIMEOUT;
 
-                if (sockTimeout == 0)
-                    sockTimeout = DFLT_SOCK_TIMEOUT;
-            }
+            if (sockTimeout == 0)
+                sockTimeout = DFLT_SOCK_TIMEOUT;
 
             impl = new ServerImpl(this);
         }
@@ -1933,7 +1929,10 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi,
T
                 U.closeQuiet(sock);
 
                 LT.warn(log, null, "Socket write has timed out (consider increasing " +
-                    "'sockTimeout' configuration property) [sockTimeout=" + sockTimeout +
']');
+                    (failureDetectionThresholdEnabled() ?
+                    "'IgniteConfiguration.failureDetectionThreshold' configuration property)
[" +
+                    "failureDetectionThreshold=" + failureDetectionThreshold() + ']' :
+                    "'sockTimeout' configuration property) [sockTimeout=" + sockTimeout +
']'));
 
                 stats.onSocketTimeout();
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ee7371b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
index a67b5cf..7e1f415 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
@@ -154,17 +154,24 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
         else
             throw new IllegalArgumentException();
 
-        if (longSockTimeouts && !useFailureDetectionThreshold()) {
-            disco.setAckTimeout(2000);
-            disco.setSocketTimeout(2000);
+        if (useFailureDetectionThreshold())
+            cfg.setFailureDetectionThreshold(failureDetectionThreshold());
+        else {
+            if (longSockTimeouts) {
+                disco.setAckTimeout(2000);
+                disco.setSocketTimeout(2000);
+            }
+            else {
+                disco.setAckTimeout(gridName.startsWith("client") ? TcpDiscoverySpi.DFLT_ACK_TIMEOUT_CLIENT
:
+                    TcpDiscoverySpi.DFLT_ACK_TIMEOUT);
+                disco.setSocketTimeout(gridName.startsWith("client") ? TcpDiscoverySpi.DFLT_SOCK_TIMEOUT_CLIENT
:
+                    TcpDiscoverySpi.DFLT_SOCK_TIMEOUT);
+            }
         }
 
         disco.setJoinTimeout(joinTimeout);
         disco.setNetworkTimeout(netTimeout);
 
-        if (useFailureDetectionThreshold())
-            cfg.setFailureDetectionThreshold(failureDetectionThreshold());
-
         disco.setClientReconnectDisabled(reconnectDisabled);
 
         if (disco instanceof TestTcpDiscoverySpi)
@@ -444,6 +451,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
         startServerNodes(2);
         startClientNodes(1);
 
+        checkNodes(2, 1);
+
         Ignite srv0 = G.ignite("server-0");
         Ignite srv1 = G.ignite("server-1");
         Ignite client = G.ignite("client-0");


Mime
View raw message