racorn edited a comment on pull request #8062:
URL: https://github.com/apache/pulsar/pull/8062#issuecomment-692653350


   @rdhabalia Thanks for adding thread safety.
   
   I notice the use of a mutex. A lock-free alternative would be more involved, 
not sure if would be worth the effort. Anyway, a possible solution could be to 
have the `ConnectionPool` take more responsibility of bootstrapping TLS 
connections. For example invoking `Bootstrap.register` instead of 
`Bootstrap.connect`, and adding the `SSLHandler` to the channel pipeline 
outside of `PulsarChannelInitializer.initChannel()` before connecting the 
channel to the remote host. The `SSLHandler` could be added in a new method in 
`PulsarChannelInitializer`, for example `CompletableFuture<Channel> 
initSSL(Channel channel, String sniHostName, int sniHostPort)`.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to