You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2019/02/25 08:44:32 UTC

[GitHub] gromtech commented on a change in pull request #6168: IGNITE-6578 Too many diagnostic: Found long running cache future

gromtech commented on a change in pull request #6168: IGNITE-6578 Too many diagnostic: Found long running cache future
URL: https://github.com/apache/ignite/pull/6168#discussion_r259721935
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
 ##########
 @@ -1935,41 +1935,61 @@ private boolean dumpLongRunningOperations0(long timeout) {
         final IgniteDiagnosticPrepareContext diagCtx = cctx.kernalContext().cluster().diagnosticEnabled() ?
             new IgniteDiagnosticPrepareContext(cctx.localNodeId()) : null;
 
+        WarningsGroup warnings = new WarningsGroup(diagnosticLog, 10);
+
         if (tm != null) {
             for (IgniteInternalTx tx : tm.activeTransactions()) {
                 if (curTime - tx.startTime() > timeout) {
                     found = true;
 
-                    U.warn(diagnosticLog, "Found long running transaction [startTime=" + formatTime(tx.startTime()) +
-                        ", curTime=" + formatTime(curTime) + ", tx=" + tx + ']');
+                    if (warnings.canAddMessage()) {
+                        warnings.add(">>> Transaction [startTime=" + formatTime(tx.startTime()) +
+                            ", curTime=" + formatTime(curTime) + ", tx=" + tx + ']');
+                    }
+                    else
+                        warnings.incTotal();
                 }
             }
         }
 
+        warnings.flush("First %d long running transactions [total=%d]");
 
 Review comment:
   The smallest visibility scope possible is a good approach. But wouldn't it be better to avoid multiple objects creation? Especially if they won't be used in most cases.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services