You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2024/11/01 04:51:39 UTC

(iotdb) branch master updated: Pipe: reduce pipe phantom reference logging frequency by omitting printing if count unchanged (#13962)

This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new af18542f505 Pipe: reduce pipe phantom reference logging frequency by omitting printing if count unchanged (#13962)
af18542f505 is described below

commit af18542f505b778e050ca98a57baf52deece564d
Author: V_Galaxy <vg...@apache.org>
AuthorDate: Fri Nov 1 12:51:33 2024 +0800

    Pipe: reduce pipe phantom reference logging frequency by omitting printing if count unchanged (#13962)
---
 .../commons/pipe/resource/ref/PipePhantomReferenceManager.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/resource/ref/PipePhantomReferenceManager.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/resource/ref/PipePhantomReferenceManager.java
index e53ff2aaa49..47ff0f51ab7 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/resource/ref/PipePhantomReferenceManager.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/resource/ref/PipePhantomReferenceManager.java
@@ -42,6 +42,8 @@ public abstract class PipePhantomReferenceManager {
 
   private static final ReferenceQueue<EnrichedEvent> REFERENCE_QUEUE = new ReferenceQueue<>();
 
+  private volatile long lastPhantomReferenceCount = -1;
+
   public PipePhantomReferenceManager() {
     // Do nothing now.
   }
@@ -77,12 +79,18 @@ public abstract class PipePhantomReferenceManager {
       // Nowhere to really log this.
     }
 
-    if (maxCount != 0 || getPhantomReferenceCount() != 0) {
+    if (count != 0) {
       LOGGER.info(
           "Clean {} pipe phantom reference(s) successfully within {} ms, remaining reference count: {}",
           count,
           System.currentTimeMillis() - startTime,
           getPhantomReferenceCount());
+    } else {
+      final long currentPhantomReferenceCount = getPhantomReferenceCount();
+      if (currentPhantomReferenceCount != lastPhantomReferenceCount) {
+        LOGGER.info("Remaining pipe phantom reference count: {}", currentPhantomReferenceCount);
+        lastPhantomReferenceCount = currentPhantomReferenceCount;
+      }
     }
   }