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-1758 debug
Date Thu, 05 Nov 2015 10:35:51 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1758 0253772c2 -> bf34693be


ignite-1758 debug


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

Branch: refs/heads/ignite-1758
Commit: bf34693beae2f63301ceaf05e4f1093162ad6b54
Parents: 0253772
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Nov 5 13:35:42 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Nov 5 13:35:42 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 48 ++++++++++++++++----
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     |  6 ++-
 2 files changed, 43 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bf34693b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index da5debf..0cc3546 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -191,10 +191,10 @@ class ServerImpl extends TcpDiscoveryImpl {
     private StatisticsPrinter statsPrinter;
 
     /** Failed nodes (but still in topology). */
-    private Collection<TcpDiscoveryNode> failedNodes = new HashSet<>();
+    private final Collection<TcpDiscoveryNode> failedNodes = new HashSet<>();
 
     /** Leaving nodes (but still in topology). */
-    private Collection<TcpDiscoveryNode> leavingNodes = new HashSet<>();
+    private final Collection<TcpDiscoveryNode> leavingNodes = new HashSet<>();
 
     /** If non-shared IP finder is used this flag shows whether IP finder contains local
address. */
     private boolean ipFinderHasLocAddr;
@@ -271,6 +271,8 @@ class ServerImpl extends TcpDiscoveryImpl {
     @Override public void spiStart(String gridName) throws IgniteSpiException {
         synchronized (mux) {
             spiState = DISCONNECTED;
+
+            debugLog(null, "spiState=" + spiState);
         }
 
         if (debugMode) {
@@ -356,6 +358,8 @@ class ServerImpl extends TcpDiscoveryImpl {
         if (disconnect) {
             synchronized (mux) {
                 spiState = DISCONNECTING;
+
+                debugLog(null, "spiState=" + spiState);
             }
         }
 
@@ -472,6 +476,8 @@ class ServerImpl extends TcpDiscoveryImpl {
             failedNodes.clear();
 
             spiState = DISCONNECTED;
+
+            debugLog(null, "spiState=" + spiState);
         }
     }
 
@@ -783,6 +789,8 @@ class ServerImpl extends TcpDiscoveryImpl {
             assert spiState == CONNECTING || spiState == DISCONNECTED;
 
             spiState = CONNECTING;
+
+            debugLog(null, "spiState=" + spiState);
         }
 
         SecurityCredentials locCred = (SecurityCredentials)locNode.getAttributes()
@@ -832,6 +840,8 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                     spiState = CONNECTED;
 
+                    debugLog(null, "spiState=" + spiState);
+
                     mux.notifyAll();
                 }
 
@@ -3119,7 +3129,7 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                 nodeAddedMsg.client(msg.client());
 
-                debugLog(nodeAddedMsg, "Process join, internalOrder=" + node.internalOrder()
+ ", msg=" + nodeAddedMsg);
+                debugLog(nodeAddedMsg, "Coordinator process join, internalOrder=" + node.internalOrder()
+ ", msg=" + nodeAddedMsg);
 
                 processNodeAddedMessage(nodeAddedMsg);
 
@@ -3343,10 +3353,18 @@ class ServerImpl extends TcpDiscoveryImpl {
                                   "coordinator for final processing [ring=" + ring + ", node="
+ node + ", locNode="
                                   + locNode + ", msg=" + msg + ']');
 
-                if (debugMode)
-                    debugLog(msg, "Local node already has node being added. Passing TcpDiscoveryNodeAddedMessage
to " +
-                                 "coordinator for final processing [ring=" + ring + ", node="
+ node + ", locNode="
-                                 + locNode + ", msg=" + msg + ']');
+                if (debugMode) {
+                    synchronized (mux) {
+                        debugLog(msg, "Local node already has node being added. Passing TcpDiscoveryNodeAddedMessage
to " +
+                            "coordinator for final processing [ring=" + ring +
+                            ", node=" + node +
+                            ", locNode=" + locNode +
+                            ", msg=" + msg +
+                            ", leaving=" + leavingNodes +
+                            ", failed=" + failedNodes +
+                            ']');
+                    }
+                }
 
                 return;
             }
@@ -3573,9 +3591,9 @@ class ServerImpl extends TcpDiscoveryImpl {
                     return;
                 }
                 else {
-                    debugLog(msg, "Coordinator incremented topVer=" + ring.topologyVersion()
+ " " + msg);
-
                     msg.topologyVersion(ring.incrementTopologyVersion());
+
+                    debugLog(msg, "Coordinator incremented topVer=" + ring.topologyVersion()
+ " " + msg);
                 }
 
                 msg.verify(locNodeId);
@@ -3657,6 +3675,8 @@ class ServerImpl extends TcpDiscoveryImpl {
                     spiState = CONNECTED;
 
                     mux.notifyAll();
+
+                    debugLog(msg, "spiState=" + spiState);
                 }
 
                 // Discovery manager must create local joined event before spiStart completes.
@@ -3689,6 +3709,8 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                         spiState = STOPPING;
 
+                        debugLog(msg, "spiState=" + spiState);
+
                         mux.notifyAll();
                     }
                 }
@@ -3708,6 +3730,8 @@ class ServerImpl extends TcpDiscoveryImpl {
                             spiState = LEFT;
 
                             mux.notifyAll();
+
+                            debugLog(msg, "spiState=" + spiState);
                         }
                     }
 
@@ -3731,6 +3755,8 @@ class ServerImpl extends TcpDiscoveryImpl {
             if (leavingNode != null) {
                 synchronized (mux) {
                     leavingNodes.add(leavingNode);
+
+                    debugLog(msg, "Add leaving " + leavingNode);
                 }
             }
             else {
@@ -3832,6 +3858,8 @@ class ServerImpl extends TcpDiscoveryImpl {
                     failedNodes.remove(leftNode);
 
                     leavingNodes.remove(leftNode);
+
+                    debugLog(msg, "Remove leaving " + leavingNode);
                 }
             }
 
@@ -3983,6 +4011,8 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                     leavingNodes.remove(node);
 
+                    debugLog(msg, "Remove leaving " + node);
+
                     ClientMessageWorker worker = clientMsgWorkers.remove(node.id());
 
                     if (worker != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/bf34693b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
index 96a1432..07e15dd 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
@@ -109,8 +109,10 @@ abstract class TcpDiscoveryImpl {
     protected void debugLog(TcpDiscoveryAbstractMessage discoMsg, String msg) {
         assert debugMode;
 
-        if ((discoMsg instanceof TcpDiscoveryCustomEventMessage) || (discoMsg instanceof
TcpDiscoveryDiscardMessage)
-            || (discoMsg instanceof TcpDiscoveryStatusCheckMessage) || (discoMsg instanceof
TcpDiscoveryHeartbeatMessage))
+        if ((discoMsg instanceof TcpDiscoveryCustomEventMessage) ||
+            (discoMsg instanceof TcpDiscoveryDiscardMessage) ||
+            (discoMsg instanceof TcpDiscoveryStatusCheckMessage) ||
+            (discoMsg instanceof TcpDiscoveryHeartbeatMessage))
             return;
 
         String msg0 = new SimpleDateFormat("[HH:mm:ss,SSS]").format(new Date(System.currentTimeMillis()))
+


Mime
View raw message