ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-1.5 Fixed TcpDiscoveryMulticastIpFinder.requestAddresses to properly wait for remote nodes addresses.
Date Thu, 17 Dec 2015 09:32:07 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1537 19d92a09f -> 0bc2e3233


ignite-1.5 Fixed TcpDiscoveryMulticastIpFinder.requestAddresses to properly wait for remote
nodes addresses.


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

Branch: refs/heads/ignite-1537
Commit: 0bc2e3233111b9a4a1ff66f2ad037218b0301aa0
Parents: 19d92a0
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Dec 17 12:31:59 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Dec 17 12:31:59 2015 +0300

----------------------------------------------------------------------
 .../multicast/TcpDiscoveryMulticastIpFinder.java        | 12 ++++++++++--
 .../ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java  |  2 +-
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0bc2e323/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
index 77bb99d..8402cbf 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
@@ -136,6 +136,9 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder
{
     /** */
     private boolean mcastErr;
 
+    @GridToStringExclude
+    private Set<InetSocketAddress> locNodeAddrs;
+
     /**
      * Constructs new IP finder.
      */
@@ -369,6 +372,8 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder
{
         }
 
         if (!clientMode) {
+            locNodeAddrs = new HashSet<>(addrs);
+
             if (addrSnds.isEmpty()) {
                 try {
                     // Create non-bound socket if local host is loopback or failed to create
sockets explicitly
@@ -403,8 +408,11 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder
{
             else
                 mcastErr = true;
         }
-        else
+        else {
             assert addrSnds.isEmpty() : addrSnds;
+
+            locNodeAddrs = Collections.emptySet();
+        }
     }
 
     /** {@inheritDoc} */
@@ -607,7 +615,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder
{
                     U.close(sock);
                 }
 
-                if (!rmtAddrs.isEmpty())
+                if (rmtAddrs.size() > locNodeAddrs.size())
                     break;
 
                 if (i < addrReqAttempts - 1) // Wait some time before re-sending address
request.

http://git-wip-us.apache.org/repos/asf/ignite/blob/0bc2e323/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
index 5475f25..5af0596 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
@@ -980,7 +980,7 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
                     }
                 }
 
-                assertTrue("GridTcpDiscoveryMulticastIpFinder should register port." , found);
+                assertTrue("TcpDiscoveryMulticastIpFinder should register port." , found);
             }
         }
         finally {


Mime
View raw message