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

jiangtian pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/dev/1.3 by this push:
     new 302a866fc69 [To dev/1.3] Pipe: Prevent duplicate error logging in 
AsyncPipeDataTransferServiceClient (#16856) (#16857)
302a866fc69 is described below

commit 302a866fc69ed0d132e269fb65b2786141f63c61
Author: Zhenyu Luo <[email protected]>
AuthorDate: Thu Dec 4 12:14:02 2025 +0800

    [To dev/1.3] Pipe: Prevent duplicate error logging in 
AsyncPipeDataTransferServiceClient (#16856) (#16857)
    
    * Pipe: Ignore logging when `returnSelf` is called in the event of an 
exception in `AsyncClient`.
    
    * 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
---
 .../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 a143100c83c..41e8c59511a 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