You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2025/11/25 01:58:20 UTC

(iotdb) branch avoid_connection_reset created (now c09f852f13b)

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

haonan pushed a change to branch avoid_connection_reset
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at c09f852f13b Avoid connection reset error log printed

This branch includes the following new commits:

     new c09f852f13b Avoid connection reset error log printed

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(iotdb) 01/01: Avoid connection reset error log printed

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c09f852f13bdcba17cf6867604f91a822d7b4780
Author: HTHou <ha...@apache.org>
AuthorDate: Tue Nov 25 09:58:02 2025 +0800

    Avoid connection reset error log printed
---
 .../src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java
index cd5eea30993..31e0f0b6960 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java
@@ -31,6 +31,7 @@ import javax.net.ssl.SSLHandshakeException;
 
 import java.io.EOFException;
 import java.net.SocketAddress;
+import java.net.SocketException;
 import java.net.SocketTimeoutException;
 
 // https://github.com/apache/thrift/blob/master/doc/specs/thrift-rpc.md
@@ -125,6 +126,10 @@ public class TElasticFramedTransport extends TTransport {
       // Read another frame of data
       readFrame();
     } catch (TTransportException e) {
+      // Adding this workaround to avoid the Connection reset error log printed.
+      if (e.getCause() instanceof SocketException && e.getMessage().contains("Connection reset")) {
+        throw new TTransportException(TTransportException.END_OF_FILE, e.getCause());
+      }
       // There is a bug fixed in Thrift 0.15. Some unnecessary error logs may be printed.
       // See https://issues.apache.org/jira/browse/THRIFT-5411 and
       // https://github.com/apache/thrift/commit/be20ad7e08fab200391e3eab41acde9da2a4fd07