ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [41/46] ignite git commit: 2.1 Added remote node pending messages in diagnostic info
Date Fri, 07 Jul 2017 09:34:44 GMT
2.1 Added remote node pending messages in diagnostic info


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

Branch: refs/heads/ignite-2.1
Commit: 9c6a65e2723ea8bdb33dde89190a1b12799faf3a
Parents: 7f16e6f
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Jul 6 15:10:24 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Jul 6 15:10:24 2017 +0300

----------------------------------------------------------------------
 .../internal/IgniteDiagnosticMessage.java       |  8 +++++++
 .../IgniteDiagnosticPrepareContext.java         |  3 +++
 .../processors/cache/GridCacheIoManager.java    | 25 +++++++++++++-------
 .../GridCachePartitionExchangeManager.java      |  7 +++++-
 4 files changed, 33 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9c6a65e2/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
index 6e6bac0..bd4ec3a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
@@ -460,6 +460,14 @@ public class IgniteDiagnosticMessage implements Message {
     }
 
     /**
+     * @param sb String builder.
+     * @param ctx Context.
+     */
+    static void dumpPendingCacheMessages(StringBuilder sb, GridKernalContext ctx) {
+        ctx.cache().context().io().dumpPendingMessages(sb);
+    }
+
+    /**
      * @param ctx Context.
      * @param nodeId Target node ID.
      * @return Communication information future.

http://git-wip-us.apache.org/repos/asf/ignite/blob/9c6a65e2/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticPrepareContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticPrepareContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticPrepareContext.java
index b55199a..416ef29 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticPrepareContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticPrepareContext.java
@@ -41,6 +41,7 @@ import static org.apache.ignite.internal.IgniteDiagnosticMessage.TxInfoClosure;
 import static org.apache.ignite.internal.IgniteDiagnosticMessage.dumpCommunicationInfo;
 import static org.apache.ignite.internal.IgniteDiagnosticMessage.dumpExchangeInfo;
 import static org.apache.ignite.internal.IgniteDiagnosticMessage.dumpNodeBasicInfo;
+import static org.apache.ignite.internal.IgniteDiagnosticMessage.dumpPendingCacheMessages;
 
 /**
  * Groups diagnostic closures by node/closure type.
@@ -193,6 +194,8 @@ public class IgniteDiagnosticPrepareContext {
 
                 sb.append(U.nl());
 
+                dumpPendingCacheMessages(sb, ctx);
+
                 sb.append(commInfo.get(10_000));
 
                 moreInfo(sb, ctx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/9c6a65e2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 1d2be13..9f1873e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -91,6 +91,7 @@ import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
 import static org.apache.ignite.internal.GridTopic.TOPIC_CACHE;
+import static org.apache.ignite.internal.util.IgniteUtils.nl;
 
 /**
  * Cache communication manager.
@@ -131,19 +132,25 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter
{
     private final List<GridCacheMessage> pendingMsgs = new ArrayList<>(MAX_STORED_PENDING_MESSAGES);
 
     /**
-     *
+     * @param sb String builder.
      */
-    public void dumpPendingMessages() {
+    public void dumpPendingMessages(StringBuilder sb) {
         synchronized (pendingMsgs) {
             if (pendingMsgs.isEmpty())
                 return;
 
-            diagnosticLog.info("Pending cache messages waiting for exchange [" +
-                "readyVer=" + cctx.exchange().readyAffinityVersion() +
-                ", discoVer=" + cctx.discovery().topologyVersion() + ']');
+            sb.append("Pending cache messages waiting for exchange [readyVer=").
+                append(cctx.exchange().readyAffinityVersion()).
+                append(", discoVer=").
+                append(cctx.discovery().topologyVersion()).append(']');
+
+            sb.append(nl());
 
-            for (GridCacheMessage msg : pendingMsgs)
-                diagnosticLog.info("Message [waitVer=" + msg.topologyVersion() + ", msg="
+ msg + ']');
+            for (GridCacheMessage msg : pendingMsgs) {
+                sb.append("Message [waitVer=").append(msg.topologyVersion()).append(", msg=").append(msg).append(']');
+
+                sb.append(nl());
+            }
         }
     }
 
@@ -341,12 +348,12 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter
{
                     append(", desc=").append(descriptorForMessage(cacheMsg)).
                     append(']');
 
-                msg0.append(U.nl()).append("Registered listeners:");
+                msg0.append(nl()).append("Registered listeners:");
 
                 Map<Integer, IgniteBiInClosure[]> idxClsHandlers0 = msgHandlers.idxClsHandlers;
 
                 for (Map.Entry<Integer, IgniteBiInClosure[]> e : idxClsHandlers0.entrySet())
-                    msg0.append(U.nl()).append(e.getKey()).append("=").append(Arrays.toString(e.getValue()));
+                    msg0.append(nl()).append(e.getKey()).append("=").append(Arrays.toString(e.getValue()));
 
                 if (cctx.kernalContext().isStopping()) {
                     if (log.isDebugEnabled())

http://git-wip-us.apache.org/repos/asf/ignite/blob/9c6a65e2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index b3cbd17..8506cde 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -1537,7 +1537,12 @@ public class GridCachePartitionExchangeManager<K, V> extends
GridCacheSharedMana
 
         cctx.affinity().dumpDebugInfo();
 
-        cctx.io().dumpPendingMessages();
+        StringBuilder pendingMsgs = new StringBuilder();
+
+        cctx.io().dumpPendingMessages(pendingMsgs);
+
+        if (pendingMsgs.length() > 0)
+            diagnosticLog.info(pendingMsgs.toString());
 
         if (IgniteSystemProperties.getBoolean(IGNITE_IO_DUMP_ON_TIMEOUT, false))
             cctx.gridIO().dumpStats();


Mime
View raw message