ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [19/37] incubator-ignite git commit: IGNITE-714 Change checkTimeout in CheckStatusSender.
Date Wed, 15 Apr 2015 10:16:03 GMT
IGNITE-714 Change checkTimeout in CheckStatusSender.


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

Branch: refs/heads/ignite-738
Commit: 49e358e03b97397e9cc5cbfa2952ef9d94e8a412
Parents: ba7527f
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Tue Apr 14 18:10:38 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Tue Apr 14 18:10:38 2015 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/49e358e0/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 1c09711..582e794 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
@@ -1088,6 +1088,9 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
     @Override public boolean pingNode(UUID nodeId) {
         assert nodeId != null;
 
+        if (log.isDebugEnabled())
+            log.debug("Ping node. NodeId: [" + nodeId + "].");
+
         if (nodeId == getLocalNodeId())
             return true;
 
@@ -2272,8 +2275,8 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
             if (log.isDebugEnabled())
                 log.debug("Status check sender has been started.");
 
-            // Only 1 heartbeat missing is acceptable. 1 sec is added to avoid false alarm.
-            long checkTimeout = (long)maxMissedHbs * hbFreq + 1000;
+            // Only 1 heartbeat missing is acceptable. Add 50 ms to avoid false alarm.
+            long checkTimeout = (long)maxMissedHbs * hbFreq + 50;
 
             long lastSent = 0;
 
@@ -2697,9 +2700,19 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
 
                 final boolean sameHost = U.sameMacs(locNode, next);
 
+                List<InetSocketAddress> localNodeAddresses = U.arrayList(locNode.socketAddresses());
+
                 addr: for (InetSocketAddress addr : getNodeAddresses(next, sameHost)) {
                     long ackTimeout0 = ackTimeout;
 
+                    if (localNodeAddresses.contains(addr)){
+                        if (log.isDebugEnabled())
+                            log.debug("Skip to send message to the local node (probably remote
node has the same " +
+                                "loopback address that local node): " + addr);
+
+                        continue;
+                    }
+
                     for (int i = 0; i < reconCnt; i++) {
                         if (sock == null) {
                             nextNodeExists = false;
@@ -2790,7 +2803,8 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
                                 errs.add(e);
 
                                 if (log.isDebugEnabled())
-                                    log.debug("Failed to connect to next node [msg=" + msg
+ ", err=" + e + ']');
+                                    U.error(log, "Failed to connect to next node [msg=" +
msg
+                                        + ", err=" + e.getMessage() + ']', e);
 
                                 onException("Failed to connect to next node [msg=" + msg
+ ", err=" + e + ']', e);
 


Mime
View raw message