zhtaoxiang commented on code in PR #12404:
URL: https://github.com/apache/pinot/pull/12404#discussion_r1487244066
##########
pinot-core/src/main/java/org/apache/pinot/core/transport/ChannelHandlerFactory.java:
##########
@@ -61,14 +64,22 @@ public static ChannelHandler getLengthFieldPrepender() {
* The {@code getClientTlsHandler} return a Client side Tls handler that
encrypt and decrypt everything.
*/
public static ChannelHandler getClientTlsHandler(TlsConfig tlsConfig,
SocketChannel ch) {
- return TlsUtils.buildClientContext(tlsConfig).newHandler(ch.alloc());
+ // Make a copy of the TlsConfig because the TlsConfig is mutable, when the
TlsConfig is used as the key of the
+ // CLIENT_SSL_CONTEXTS_CACHE, the TlsConfig should not be changed.
+ TlsConfig tlsConfigCopy = new TlsConfig(tlsConfig);
Review Comment:
The frequency should be low, only at the time when the channel is created.
It is the same as how many times the channel should be created.
Anyway, changed the map to use hashCode as the key, so the object copy can
be avoided.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]