ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [50/50] [abbrv] ignite git commit: TCP communication skip local node loopback address
Date Fri, 13 Oct 2017 17:43:35 GMT
TCP communication skip local node loopback address


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

Branch: refs/heads/ignite-2.1.5-p1
Commit: cc87a6215ed3d91948f6d0fa04b104a1e33a40be
Parents: d9a2786
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Fri Oct 13 20:41:56 2017 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Fri Oct 13 20:41:56 2017 +0300

----------------------------------------------------------------------
 .../spi/communication/tcp/TcpCommunicationSpi.java   | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cc87a621/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 1dd48d1..15faeb3 100755
--- 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
@@ -2987,6 +2987,10 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements
Communicati
         if (isExtAddrsExist)
             addrs.addAll(extAddrs);
 
+        if (log.isDebugEnabled())
+            log.debug("Addresses resolved from attributes [rmtNode=" + node.id() + ", addrs="
+ addrs +
+                ", isRmtAddrsExist=" + isRmtAddrsExist + ']');
+
         Set<InetAddress> allInetAddrs = U.newHashSet(addrs.size());
 
         for (InetSocketAddress addr : addrs) {
@@ -3015,7 +3019,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements
Communicati
         }
 
         if (log.isDebugEnabled())
-            log.debug("Addresses to connect for node [rmtNode=" + node.id() + ", addrs="
+ addrs.toString() + ']');
+            log.debug("Addresses to connect for node [rmtNode=" + node.id() + ", addrs="
+ addrs + ']');
 
         boolean conn = false;
         GridCommunicationClient client = null;
@@ -3024,6 +3028,15 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements
Communicati
         int connectAttempts = 1;
 
         for (InetSocketAddress addr : addrs) {
+            if (addr.getAddress().isLoopbackAddress() && addr.getPort() == boundTcpPort)
{
+                if (log.isDebugEnabled())
+                    log.debug("Skipping local address [addr=" + addr +
+                        ", locAddrs=" + node.attribute(createSpiAttributeName(ATTR_ADDRS))
+
+                        ", node=" + node + ']');
+
+                continue;
+            }
+
             long connTimeout0 = connTimeout;
 
             int attempt = 1;


Mime
View raw message