[ 
https://issues.apache.org/jira/browse/KAFKA-8154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17544632#comment-17544632
 ] 

Vineeth commented on KAFKA-8154:
--------------------------------

I tried patch [9188|https://github.com/apache/kafka/pull/9188]. it didnt solv 
the issue. I tried to reproduce the issue and i can reproduce the issue 
consistently in the following conditions.

1. [Conscrypt|https://github.com/google/conscrypt] as ssl provider 
2. openjdk-11-jdk

I checked by adding additional logs and could find that the packet buffer size 
and app buffer returned by Conscrypt ssl engine mismatches. Below are the logs 
that i got
{code:java}
SSl engine class org.conscrypt.Java8EngineWrapper 
(org.apache.kafka.common.network.SslTransportLayer)
SSl engine session class org.conscrypt.Java8ExtendedSSLSession 
(org.apache.kafka.common.network.SslTransportLayer)
SSl engine session App Buffer Size 16384 
(org.apache.kafka.common.network.SslTransportLayer)
SSl engine session Net Buffer Size 16709 
(org.apache.kafka.common.network.SslTransportLayer) {code}
Since this was a blocker, i modified  the Ssltransportlayer to have 
appreadbuffer atleast the same size as netreadbuffer, before call to unwrap. Is 
it ok to have appReadBuffer atleast the same size as netReadBuffer ?

so far  the clusters are running smoothly without buffer overflow or underflow 
issue. 
{code:java}
while (netReadBuffer.position() > 0) {
             netReadBuffer.flip();
             SSLEngineResult unwrapResult;
             try {
                 appReadBuffer = Utils.ensureCapacity(appReadBuffer, 
netReadBufferSize());
                 unwrapResult = sslEngine.unwrap(netReadBuffer, appReadBuffer); 
{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.7#820007)

Reply via email to