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

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

commit 0657671d20f5cb2694d3ab5fe1b09a47f3f231c6
Author: Haonan <[email protected]>
AuthorDate: Mon Nov 10 09:43:43 2025 +0800

    Avoid unnecessary ssl error log caused by jdk bug (#16709)
    
    (cherry picked from commit 9d4c41092a85d819ae18aba0fbdcb0e5ee203d46)
---
 .../apache/iotdb/rpc/NettyTNonblockingTransport.java |  9 +++++----
 .../apache/iotdb/rpc/TElasticFramedTransport.java    | 20 ++++++++++++++------
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git 
a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonblockingTransport.java
 
b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonblockingTransport.java
index b42b901cc18..549e1bb2e0b 100644
--- 
a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonblockingTransport.java
+++ 
b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonblockingTransport.java
@@ -168,10 +168,11 @@ public class NettyTNonblockingTransport extends 
TNonblockingTransport {
                                   "SSL handshake completed successfully for 
{}:{}", host, port);
                             }
                           } else {
-                            if (!future
-                                .cause()
-                                .getMessage()
-                                .contains("SslHandler removed before handshake 
completed")) {
+                            if (future.cause().getMessage() != null
+                                && !future
+                                    .cause()
+                                    .getMessage()
+                                    .contains("SslHandler removed before 
handshake completed")) {
                               logger.warn(
                                   "SSL handshake failed for {}:{}", host, 
port, future.cause());
                             } else if (logger.isDebugEnabled()) {
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 c366d8a9333..6008988a809 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
@@ -132,13 +132,21 @@ public class TElasticFramedTransport extends TTransport {
       if (e.getCause() instanceof SocketTimeoutException) {
         throw new TTransportException(TTransportException.TIMED_OUT, 
e.getCause());
       }
-      // When client with SSL shut down due to time out. Some unnecessary 
error logs may be printed.
-      // Adding this workaround to avoid the problem.
-      if (e.getCause() instanceof SSLHandshakeException
-          && e.getCause().getCause() != null
-          && e.getCause().getCause() instanceof EOFException) {
-        throw new TTransportException(TTransportException.END_OF_FILE, 
e.getCause());
+      if (e.getCause() instanceof SSLHandshakeException) {
+        // There is an unsolved JDK bug 
https://bugs.openjdk.org/browse/JDK-8221218.
+        // Adding this workaround to avoid the error log printed.
+        if (e.getMessage()
+            .contains("Insufficient buffer remaining for AEAD cipher fragment 
(2).")) {
+          throw new TTransportException(TTransportException.END_OF_FILE, 
e.getCause());
+        }
+        // When client with SSL shutdown due to time out. Some unnecessary 
error logs may be
+        // printed.
+        // Adding this workaround to avoid the problem.
+        if (e.getCause().getCause() != null && e.getCause().getCause() 
instanceof EOFException) {
+          throw new TTransportException(TTransportException.END_OF_FILE, 
e.getCause());
+        }
       }
+
       if (e.getCause() instanceof SSLException
           && e.getMessage().contains("Unsupported or unrecognized SSL 
message")) {
         SocketAddress remoteAddress = null;

Reply via email to