ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [4/5] incubator-ignite git commit: # IGNITE-709 Fix problem in TcpDiscoverySpi.RingMessageWorker#processClientReconnectMessage() (cherry picked from commit eda676b)
Date Wed, 29 Apr 2015 10:18:42 GMT
# IGNITE-709 Fix problem in TcpDiscoverySpi.RingMessageWorker#processClientReconnectMessage()
(cherry picked from commit eda676b)


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

Branch: refs/heads/ignite-831
Commit: f7be0f20dab2db121fc8eaeca9d6b5fd0c006cf2
Parents: 177077b
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Sun Apr 19 19:11:14 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed Apr 29 13:14:33 2015 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 76 +++++++++++---------
 1 file changed, 41 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f7be0f20/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 47b17ac..bd3d648 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
@@ -3438,54 +3438,60 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
                 assert isLocNodeRouter;
 
                 msg.verify(locNodeId);
+
+                if (ring.hasRemoteNodes()) {
+                    sendMessageAcrossRing(msg);
+
+                    return;
+                }
             }
-            else {
-                UUID nodeId = msg.creatorNodeId();
 
-                TcpDiscoveryNode node = ring.node(nodeId);
+            UUID nodeId = msg.creatorNodeId();
 
-                assert node == null || node.isClient();
+            TcpDiscoveryNode node = ring.node(nodeId);
 
-                if (node != null) {
-                    assert node.isClient();
+            assert node == null || node.isClient();
 
-                    node.clientRouterNodeId(msg.routerNodeId());
-                    node.aliveCheck(maxMissedClientHbs);
+            if (node != null) {
+                assert node.isClient();
 
-                    if (isLocalNodeCoordinator()) {
-                        Collection<TcpDiscoveryAbstractMessage> pending =
-                            pendingMsgs.messages(msg.lastMessageId());
+                node.clientRouterNodeId(msg.routerNodeId());
+                node.aliveCheck(maxMissedClientHbs);
 
-                        if (pending != null) {
-                            msg.pendingMessages(pending);
-                            msg.success(true);
-                        }
-                        else {
-                            if (log.isDebugEnabled())
-                                log.debug("Failing reconnecting client node because failed
to restore pending " +
-                                    "messages [locNodeId=" + locNodeId + ", clientNodeId="
+ nodeId + ']');
+                if (isLocalNodeCoordinator()) {
+                    Collection<TcpDiscoveryAbstractMessage> pending =
+                        pendingMsgs.messages(msg.lastMessageId());
 
-                            processNodeFailedMessage(new TcpDiscoveryNodeFailedMessage(locNodeId,
-                                node.id(), node.order()));
-                        }
+                    if (pending != null) {
+                        msg.pendingMessages(pending);
+                        msg.success(true);
                     }
-                }
-                else if (log.isDebugEnabled())
-                    log.debug("Reconnecting client node is already failed [nodeId=" + nodeId
+ ']');
-
-                if (isLocNodeRouter) {
-                    ClientMessageWorker wrk = clientMsgWorkers.get(nodeId);
+                    else {
+                        if (log.isDebugEnabled())
+                            log.debug("Failing reconnecting client node because failed to
restore pending " +
+                                "messages [locNodeId=" + locNodeId + ", clientNodeId=" +
nodeId + ']');
 
-                    if (wrk != null)
-                        wrk.addMessage(msg);
-                    else if (log.isDebugEnabled())
-                        log.debug("Failed to reconnect client node (disconnected during the
process) [locNodeId=" +
-                            locNodeId + ", clientNodeId=" + nodeId + ']');
+                        processNodeFailedMessage(new TcpDiscoveryNodeFailedMessage(locNodeId,
+                            node.id(), node.internalOrder()));
+                    }
                 }
             }
+            else if (log.isDebugEnabled())
+                log.debug("Reconnecting client node is already failed [nodeId=" + nodeId
+ ']');
 
-            if (ring.hasRemoteNodes())
-                sendMessageAcrossRing(msg);
+            if (isLocNodeRouter) {
+                ClientMessageWorker wrk = clientMsgWorkers.get(nodeId);
+
+                if (wrk != null)
+                    wrk.addMessage(msg);
+                else if (log.isDebugEnabled())
+                    log.debug("Failed to reconnect client node (disconnected during the process)
[locNodeId=" +
+                        locNodeId + ", clientNodeId=" + nodeId + ']');
+            }
+            else {
+                if (ring.hasRemoteNodes())
+                    sendMessageAcrossRing(msg);
+            }
         }
 
         /**


Mime
View raw message