You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "satwik-pachigolla (via GitHub)" <gi...@apache.org> on 2026/04/06 15:24:15 UTC
[PR] Best-effort warmup of Calcite compile pipeline on MSE broker startup [pinot]
satwik-pachigolla opened a new pull request, #18111:
URL: https://github.com/apache/pinot/pull/18111
Solution for https://github.com/apache/pinot/issues/18110
Adds a best-effort warmup of the multistage query compilation path in broker startup.
This is not a readiness check since
- Control planes can also be responsible for warming up query paths, so this is a lightweight solution within Pinot
- A readiness check requires a more nuanced approach. Does it keep attempting warmups until the compilation converges on a specific time? How long do we wait on convergence? What do we do if it does take too long?
Restarting brokers with this change does not result in any `Timed out while planning query` errors mentioned in the issue.
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of compile pipeline on MSE broker startup [pinot]
Posted by "satwik-pachigolla (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of compile pipeline on MSE broker startup [pinot]
Posted by "satwik-pachigolla (via GitHub)" <gi...@apache.org>.
satwik-pachigolla commented on code in PR #18111:
URL: https://github.com/apache/pinot/pull/18111#discussion_r3042133066
##########
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);
Review Comment:
Reduced to 5s, I've been seeing ~500 ms on the compilation warmup times. This is a defensive limit so I don't think we need to go more narrow than that.
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of compile pipeline on MSE broker startup [pinot]
Posted by "satwik-pachigolla (via GitHub)" <gi...@apache.org>.
satwik-pachigolla commented on code in PR #18111:
URL: https://github.com/apache/pinot/pull/18111#discussion_r3042122420
##########
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);
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of compile pipeline on MSE broker startup [pinot]
Posted by "satwik-pachigolla (via GitHub)" <gi...@apache.org>.
satwik-pachigolla commented on PR #18111:
URL: https://github.com/apache/pinot/pull/18111#issuecomment-4200655491
@yashmayya looks like the latest run builds did not flake
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of Calcite compile pipeline on MSE broker startup [pinot]
Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya commented on code in PR #18111:
URL: https://github.com/apache/pinot/pull/18111#discussion_r3041604469
##########
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.
Review Comment:
nit: let's add a full link to the GitHub issue
##########
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);
Review Comment:
30 seconds seems to be quite long - how long have you seen this warmup query compilation take in your clusters?
##########
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);
Review Comment:
+1 on closing the compiled query and planner context
##########
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:
+1, let's use `WARN`
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of compile pipeline on MSE broker startup [pinot]
Posted by "satwik-pachigolla (via GitHub)" <gi...@apache.org>.
satwik-pachigolla commented on code in PR #18111:
URL: https://github.com/apache/pinot/pull/18111#discussion_r3042131111
##########
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.
Review Comment:
Updated comment, I did some more investigation and this was because the first queries to hit the broker had 1s overall timeouts so the ~500 ms of latency the cold start adds pushed them over the timeout so it's not really related to that PR.
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of Calcite compile pipeline on MSE broker startup [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #18111:
URL: https://github.com/apache/pinot/pull/18111#issuecomment-4193403139
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/18111?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 56.07%. Comparing base ([`a90e1ae`](https://app.codecov.io/gh/apache/pinot/commit/a90e1ae4af32e5758e0292599bdfd88a845ec41a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3c9ae94`](https://app.codecov.io/gh/apache/pinot/commit/3c9ae94617264f2990f1892eab8cae74ff4a3caa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 19 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #18111 +/- ##
============================================
- Coverage 56.11% 56.07% -0.05%
Complexity 778 778
============================================
Files 2469 2470 +1
Lines 140563 141381 +818
Branches 22509 22735 +226
============================================
+ Hits 78877 79277 +400
- Misses 54977 55322 +345
- Partials 6709 6782 +73
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/18111/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [java-21](https://app.codecov.io/gh/apache/pinot/pull/18111/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.07% <ø> (-0.05%)` | :arrow_down: |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/18111/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.07% <ø> (-0.05%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/18111/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.07% <ø> (-0.05%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/18111/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.07% <ø> (-0.05%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/18111?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of Calcite compile pipeline on MSE broker startup [pinot]
Posted by "satwik-pachigolla (via GitHub)" <gi...@apache.org>.
satwik-pachigolla commented on PR #18111:
URL: https://github.com/apache/pinot/pull/18111#issuecomment-4193573470
@suvodeep-pyne @yashmayya
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of Calcite compile pipeline on MSE broker startup [pinot]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #18111:
URL: https://github.com/apache/pinot/pull/18111#discussion_r3041608451
##########
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);
Review Comment:
`warmupEnv.compile("SELECT 1")` returns a `QueryEnvironment.CompiledQuery` (which is `Closeable`) and should be closed; otherwise the underlying `PlannerContext` can leak resources. Consider using try-with-resources around the compile call even though you discard the result.
```suggestion
exec.submit(() -> {
try (QueryEnvironment.CompiledQuery compiledQuery = warmupEnv.compile("SELECT 1")) {
return compiledQuery;
}
}).get(30, TimeUnit.SECONDS);
```
##########
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();
Review Comment:
`warmupCompile()` runs synchronously inside `start()`, which can delay broker startup by up to 30 seconds on slow/classloading-heavy environments. If this is intended, consider making the warmup and/or its timeout configurable, or running it asynchronously so startup/readiness isn’t blocked by best-effort behavior.
```suggestion
// Warmup is best-effort and should not block broker startup/readiness.
_queryCompileExecutor.submit(this::warmupCompile);
```
##########
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:
Since this is explicitly “best-effort” and the broker continues serving traffic on failure, logging at ERROR may be misleading/noisy for operators. Consider downgrading to WARN (or INFO) and including the elapsed time/exception message to aid diagnosis without implying a fatal startup failure.
##########
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();
Review Comment:
The warmup uses a new `Executors.newSingleThreadExecutor()` with the default (non-daemon) thread factory. If compilation times out and doesn’t respond to interrupts, `shutdownNow()` may not stop the worker thread, leaving a stray non-daemon thread running for the lifetime of the broker. Prefer reusing `_queryCompileExecutor` (and its cancellation logic) or create the executor with a `NamedThreadFactory(..., true)`, cancel the `Future`, and `awaitTermination`.
```suggestion
ExecutorService exec = Executors.newSingleThreadExecutor(new NamedThreadFactory("mse-startup-warmup", true));
Future<?> future = null;
try {
future = exec.submit(() -> warmupEnv.compile("SELECT 1"));
future.get(30, TimeUnit.SECONDS);
} finally {
if (future != null && !future.isDone()) {
future.cancel(true);
}
exec.shutdownNow();
try {
if (!exec.awaitTermination(1, TimeUnit.SECONDS)) {
LOGGER.warn("MSE startup warmup executor did not terminate within the grace period");
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
LOGGER.warn("Interrupted while waiting for MSE startup warmup executor to terminate");
}
```
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of compile pipeline on MSE broker startup [pinot]
Posted by "satwik-pachigolla (via GitHub)" <gi...@apache.org>.
satwik-pachigolla commented on code in PR #18111:
URL: https://github.com/apache/pinot/pull/18111#discussion_r3042133066
##########
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);
Review Comment:
Reduced to 5s, I've been seeing ~500 ms on the compilation warmup times.
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Best-effort warmup of compile pipeline on MSE broker startup [pinot]
Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya merged PR #18111:
URL: https://github.com/apache/pinot/pull/18111
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org