From 35f5e90067530bc727612318f312515105897474 Mon Sep 17 00:00:00 2001 From: Siyang Tang Date: Mon, 12 Aug 2024 17:57:42 +0800 Subject: [PATCH] Revert "[fix](SSL) Correctly close SSL connections (#38587)" This reverts commit a03a1c2d494ea5a473e77cb1578f625d59218eb3. --- .../src/main/java/org/apache/doris/mysql/MysqlChannel.java | 2 +- .../main/java/org/apache/doris/qe/MysqlConnectProcessor.java | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlChannel.java b/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlChannel.java index 61216c0a4506f4..392b0587585ed5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlChannel.java +++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlChannel.java @@ -314,7 +314,7 @@ public ByteBuffer fetchOnePacket() throws IOException { // before read, set limit to make read only one packet result.limit(result.position() + packetLen); readLen = readAll(result, false); - if (isSslMode && remainingBuffer.position() == 0 && result.hasRemaining()) { + if (isSslMode && remainingBuffer.position() == 0) { byte[] header = result.array(); int packetId = header[3] & 0xFF; if (packetId != sequenceId) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java index fa5be19c44db76..165767c8611859 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java @@ -344,11 +344,6 @@ public void processOnce() throws IOException { LOG.warn("Null packet received from network. remote: {}", channel.getRemoteHostPortString()); throw new IOException("Error happened when receiving packet."); } - if (!packetBuf.hasRemaining()) { - LOG.info("No more data to be read. Close connection. remote={}", channel.getRemoteHostPortString()); - ctx.setKilled(); - return; - } } catch (AsynchronousCloseException e) { // when this happened, timeout checker close this channel // killed flag in ctx has been already set, just return