satwik-pachigolla commented on code in PR #18111:
URL: https://github.com/apache/pinot/pull/18111#discussion_r3042121633
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -198,6 +198,29 @@ public MultiStageBrokerRequestHandler(PinotConfiguration
config, String brokerId
@Override
public void start() {
_queryDispatcher.start();
+ warmupCompile();
+ }
+
+ /**
+ * Best-effort warmup of the Calcite compile pipeline before serving
traffic. Reduces but does
+ * not guarantee that cold-start compilation times won't breach the timeout
limit enforced in #14946.
+ */
+ private void warmupCompile() {
+ try {
+ ImmutableQueryEnvironment.Config warmupConf = getQueryEnvConf(null,
Map.of(), -1L);
+ QueryEnvironment warmupEnv = new QueryEnvironment(warmupConf,
_multiClusterRoutingContext);
+ long startMs = System.currentTimeMillis();
+ LOGGER.info("MSE startup warmup: compiling query");
+ ExecutorService exec = Executors.newSingleThreadExecutor();
+ try {
+ exec.submit(() -> warmupEnv.compile("SELECT 1")).get(30,
TimeUnit.SECONDS);
+ } finally {
+ exec.shutdownNow();
+ }
+ LOGGER.info("MSE startup warmup completed in {}ms",
System.currentTimeMillis() - startMs);
+ } catch (Exception e) {
+ LOGGER.error("MSE broker startup warmup failed", e);
+ }
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: [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]