Skip to content

perf: Interrupt controllers when canceling them.#19233

Open
gianm wants to merge 6 commits intoapache:masterfrom
gianm:msq-controller-interrupt
Open

perf: Interrupt controllers when canceling them.#19233
gianm wants to merge 6 commits intoapache:masterfrom
gianm:msq-controller-interrupt

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Mar 30, 2026

In PRs #18095 and #18931, worker cancellation was switched to use interrupts with a lightweight non-interrupt-based failsafe. This patch implements a similar idea for controllers, to aid in more prompt cancellation in cases where the controller is blocking on something.

The main change is to track the controller thread in ControllerHolder and interrupt it on cancel(), in addition to calling controller.stop(). ControllerHolder is also moved from dart.controller to msq.exec, since it is now a shared class, no longer Dart-specific. In addition, the workerOffline logic is moved to Dart's ControllerMessageListener, since that really is Dart-specific.

In PRs apache#18095 and apache#18931, worker cancellation was switched to use
interrupts with a lightweight non-interrupt-based failsafe. This patch
implements a similar idea for controllers, to aid in more prompt
cancellation in cases where the controller is blocking on something.

The main change is to track the controller thread in ControllerHolder
and interrupt it on cancel(), in addition to calling controller.stop().
ControllerHolder is also moved from dart.controller to msq.exec, since
it is now a shared class, no longer Dart-specific. In addition, the
"workerOffline" logic is moved to Dart's ControllerMessageListener,
since that really is Dart-specific.
@github-actions github-actions bot added Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 labels Mar 30, 2026
return;
}

switch (report.getStatus().getStatus()) {

Check warning

Code scanning / CodeQL

Missing enum case in switch Warning

Switch statement does not have a case for
RUNNING
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants