anandheritage commented on code in PR #13645: URL: https://github.com/apache/pinot/pull/13645#discussion_r1730225393
########## pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/DispatchClient.java: ########## @@ -36,12 +52,28 @@ */ class DispatchClient { private static final StreamObserver<Worker.CancelResponse> NO_OP_CANCEL_STREAM_OBSERVER = new CancelObserver(); + private static final Logger LOGGER = LoggerFactory.getLogger(DispatchClient.class); + // the key is the hashCode of the TlsConfig, the value is the SslContext + // We don't use TlsConfig as the map key because the TlsConfig is mutable, which means the hashCode can change. If the + // hashCode changes and the map is resized, the SslContext of the old hashCode will be lost. + private static final Map<Integer, SslContext> CLIENT_SSL_CONTEXTS_CACHE = new ConcurrentHashMap<>(); private final ManagedChannel _channel; private final PinotQueryWorkerGrpc.PinotQueryWorkerStub _dispatchStub; public DispatchClient(String host, int port) { - _channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build(); + this(host, port, new GrpcConfig(Collections.emptyMap())); + } + public DispatchClient(String host, int port, GrpcConfig grpcConfig) { + if (grpcConfig.isUsePlainText()) { + _channel = + ManagedChannelBuilder.forAddress(host, port).maxInboundMessageSize(grpcConfig.getMaxInboundMessageSizeBytes()) Review Comment: Done. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org