fix: Do not launch Kubernetes tasks killed while waiting for capacity #20738
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.59) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 176 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.310
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.059
Real PR Conversation Timeline
1 comments
"Review active on #20738"
general
weight: 0.35
capistrant
Description
A task killed while waiting for a free
KubernetesTaskRunnerthread is still launched once a thread frees up. Since #16036,shutdown()keeps work items whose future is not done, andKubernetesPeonLifecycle.shutdown()does nothing inNOT_STARTED, sodoTask()later runs the job for a task the Overlord has already failed.doTask()returns a FAILED status without launching when the work item was shut down. For restored jobs it saves the logs first.KubernetesPeonLifecycle.shutdown()movesNOT_STARTEDtoSTOPPEDand always deletes the job, so a racingrun()orjoin()cannot launch it.#20298 tracks the same bug in
HttpRemoteTaskRunner.Release note
Fixed an issue where a task killed while waiting for capacity in the Kubernetes task runner was still launched.
<hr>
##### Key changed/added classes in this PR
KubernetesTaskRunnerKubernetesPeonLifecycle<hr>
This PR has:
- [x] using the concurrency checklist (Remove this item if the PR doesn't have any relation to concurrency.)