You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2025/11/25 07:45:32 UTC
(iotdb) branch master updated: Avoid connection reset error log printed (#16797)
This is an automated email from the ASF dual-hosted git repository.
jiangtian 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 fbcb8a2c6ed Avoid connection reset error log printed (#16797)
fbcb8a2c6ed is described below
commit fbcb8a2c6ed44c635d3054adb9c7c3bf8448c418
Author: Haonan <hh...@outlook.com>
AuthorDate: Tue Nov 25 15:45:26 2025 +0800
Avoid connection reset error log printed (#16797)
---
.../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