[ https://issues.apache.org/jira/browse/KAFKA-8154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17731036#comment-17731036 ]
tony mancill commented on KAFKA-8154: ------------------------------------- Thank you for the testing and the feedback [~keith.paulson] . We are now starting testing with a more minimal patch: *2.8.2* {code:java} diff --git a/clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java b/clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java index b9879ad6da..19c8a73eae 100644 --- a/clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java +++ b/clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java @@ -344,9 +344,9 @@ public class SslTransportLayer implements TransportLayer { netWriteBuffer.compact(); netWriteBuffer = Utils.ensureCapacity(netWriteBuffer, currentNetWriteBufferSize); netWriteBuffer.flip(); - if (netWriteBuffer.limit() >= currentNetWriteBufferSize) { + if (netWriteBuffer.limit() > currentNetWriteBufferSize) { throw new IllegalStateException("Buffer overflow when available data size (" + netWriteBuffer.limit() + - ") >= network buffer size (" + currentNetWriteBufferSize + ")"); + ") > network buffer size (" + currentNetWriteBufferSize + ")"); } } else if (handshakeResult.getStatus() == Status.BUFFER_UNDERFLOW) { throw new IllegalStateException("Should not have received BUFFER_UNDERFLOW during handshake WRAP."); @@ -598,7 +598,7 @@ public class SslTransportLayer implements TransportLayer { ") >= application buffer size (" + currentApplicationBufferSize + ")"); } - // appReadBuffer will extended upto currentApplicationBufferSize + // appReadBuffer will extend up to currentApplicationBufferSize // we need to read the existing content into dst before we can do unwrap again. If there are no space in dst // we can break here. if (dst.hasRemaining()) {code} *3.4.0* {code:java} diff --git a/clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java b/clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java index 904c5216a4..8c1abfdf9d 100644 --- a/clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java +++ b/clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java @@ -349,9 +349,9 @@ public class SslTransportLayer implements TransportLayer { netWriteBuffer.compact(); netWriteBuffer = Utils.ensureCapacity(netWriteBuffer, currentNetWriteBufferSize); netWriteBuffer.flip(); - if (netWriteBuffer.limit() >= currentNetWriteBufferSize) { + if (netWriteBuffer.limit() > currentNetWriteBufferSize) { throw new IllegalStateException("Buffer overflow when available data size (" + netWriteBuffer.limit() + - ") >= network buffer size (" + currentNetWriteBufferSize + ")"); + ") > network buffer size (" + currentNetWriteBufferSize + ")"); } } else if (handshakeResult.getStatus() == Status.BUFFER_UNDERFLOW) { throw new IllegalStateException("Should not have received BUFFER_UNDERFLOW during handshake WRAP."); @@ -608,7 +608,7 @@ public class SslTransportLayer implements TransportLayer { ") >= application buffer size (" + currentApplicationBufferSize + ")"); } - // appReadBuffer will extended upto currentApplicationBufferSize + // appReadBuffer will extend up to currentApplicationBufferSize // we need to read the existing content into dst before we can do unwrap again. If there are no space in dst // we can break here. if (dst.hasRemaining()) {code} > Buffer Overflow exceptions between brokers and with clients > ----------------------------------------------------------- > > Key: KAFKA-8154 > URL: https://issues.apache.org/jira/browse/KAFKA-8154 > Project: Kafka > Issue Type: Bug > Components: clients > Affects Versions: 2.1.0 > Reporter: Rajesh Nataraja > Priority: Major > Attachments: server.properties.txt > > > https://github.com/apache/kafka/pull/6495 > https://github.com/apache/kafka/pull/5785 -- This message was sent by Atlassian Jira (v8.20.10#820010)