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

jackietien pushed a commit to branch ty/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit ad448bc0243f0c2ddde8bbf7ba4c83b776ad3059
Author: Zhenyu Luo <[email protected]>
AuthorDate: Thu Dec 4 12:13:45 2025 +0800

    Pipe: Prevent duplicate error logging in AsyncPipeDataTransferServiceClient 
(#16856)
    
    * Fix: Prevent duplicate error logging in AsyncPipeDataTransferServiceClient
    
    - Change printLogWhenEncounterException from final to mutable field
    - Set printLogWhenEncounterException to false in onError() to avoid 
repeated error logs
    - This prevents flooding logs when client encounters errors
    
    * update
    
    (cherry picked from commit f4d628a7d6aa98b4373e48cc41cb955c745f75cb)
---
 .../thrift/async/handler/PipeTransferTrackableHandler.java         | 1 +
 .../commons/client/async/AsyncPipeDataTransferServiceClient.java   | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/handler/PipeTransferTrackableHandler.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/handler/PipeTransferTrackableHandler.java
index 8a552f0cbee..21f7c144bed 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/handler/PipeTransferTrackableHandler.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/handler/PipeTransferTrackableHandler.java
@@ -64,6 +64,7 @@ public abstract class PipeTransferTrackableHandler
   public void onError(final Exception exception) {
     if (client != null) {
       ThriftClient.resolveException(exception, client);
+      client.setPrintLogWhenEncounterException(false);
     }
 
     if (connector.isClosed()) {
diff --git 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncPipeDataTransferServiceClient.java
 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncPipeDataTransferServiceClient.java
index e5a89215817..36295ec8500 100644
--- 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncPipeDataTransferServiceClient.java
+++ 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncPipeDataTransferServiceClient.java
@@ -49,7 +49,7 @@ public class AsyncPipeDataTransferServiceClient extends 
IClientRPCService.AsyncC
   private static final AtomicInteger idGenerator = new AtomicInteger(0);
   private final int id = idGenerator.incrementAndGet();
 
-  private final boolean printLogWhenEncounterException;
+  private boolean printLogWhenEncounterException;
 
   private final TEndPoint endpoint;
   private final ClientManager<TEndPoint, AsyncPipeDataTransferServiceClient> 
clientManager;
@@ -85,6 +85,7 @@ public class AsyncPipeDataTransferServiceClient extends 
IClientRPCService.AsyncC
   public void onError(final Exception e) {
     super.onError(e);
     ThriftClient.resolveException(e, this);
+    setPrintLogWhenEncounterException(false);
     returnSelf(
         (i) -> i instanceof IllegalStateException && "Client has an 
error!".equals(i.getMessage()));
   }
@@ -106,6 +107,10 @@ public class AsyncPipeDataTransferServiceClient extends 
IClientRPCService.AsyncC
     return printLogWhenEncounterException;
   }
 
+  public void setPrintLogWhenEncounterException(final boolean 
printLogWhenEncounterException) {
+    this.printLogWhenEncounterException = printLogWhenEncounterException;
+  }
+
   /**
    * return self, the method doesn't need to be called by the user and will be 
triggered after the
    * RPC is finished.

Reply via email to