fix: complete tasks killed while HRTR waits for the worker to report them #20890
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 244 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.329
Real PR Conversation Timeline
1 comments
"Review active on #20890"
general
weight: 0.35
amaechler
Follow-up to #20773 and #20867.
Description
After the Overlord sends a task to a MiddleManager or Indexer,
HttpRemoteTaskRunnerwaits up todruid.indexer.runner.taskAssignmentTimeout(5 minutes by default) for the worker to report it. It also waits when the assign request fails and the Overlord cannot tell whether the task arrived. The runner ignored a kill during this wait until the timeout: the task kept counting as pending, so autoscaling could treat it as demand, and the timeout then raised a "Task assignment timed out" alert for a task that was already gone.Fix
shutdown()now wakes the waiting thread, which marks the killed task FAILED right away. The worker stays reserved until it reports the task or the timeout passes, because it may hold the task without the Overlord knowing, and workers accept tasks beyond their capacity. If the worker reports the task, the Overlord tells it to stop, as it already does for completed tasks. A killed task no longer raises the timeout alert.Tests
The new
testShutdownTaskWhileWaitingForWorkerToReportItcovers a worker that never reports the killed task, reports it RUNNING, or reports it FAILED. All three cases fail without the fix.testShutdownTaskBeingAssigned(true)drops two assertions that depended on whether the kill or the worker's report arrived first.Release note
A task killed while the Overlord waits for a worker to confirm its assignment no longer stays pending for up to 5 minutes or raises a "Task assignment timed out" alert.
<hr>
This PR has:
- [x] using the concurrency checklist