lhotari opened a new pull request, #23115: URL: https://github.com/apache/pulsar/pull/23115
### Motivation In Pulsar, there has been a long time workaround (#2464) for a Netty SslHandler issue where the input ByteBuf instances get mutated. After Netty 4.1.111.Final, it's no longer necessary to make buffer copies when TLS is enabled. This change on Netty side https://github.com/netty/netty/pull/14086 contains the fix. ### Modifications Since the Pulsar client might get used with an older Netty version, it's necessary to detect that the Netty version contains the fix. The simplest way to detect Netty 4.1.111.Final is by checking for existence of the class `io.netty.handler.ssl.SslHandlerCoalescingBufferQueue` since that class was extracted from an inner class in 4.1.111.Final. Instead of referencing `ByteBufPair.ENCODER` and `ByteBufPair.COPYING_ENCODER` directly, use `ByteBufPair.getEncoder(tlsEnabled)` to choose the correct encoder. The COPYING_ENCODER will only be used if an older Netty version is detected. This could be the case when a client application uses the pulsar-client-original maven dependency and the application uses an older Netty version. ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
