Report cancelled and timed-out Dispatcher batches and jobs #25505
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 540 lines diff across 6 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.377
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #25505"
general
weight: 0.35
HadhemiDD
What does this PR do?
Reports cancelled and timed-out Dispatcher batches and jobs as their own outcomes. GitHub reports a job stopped by
timeout-minutesascancelled, so the Dispatcher tells the two apart itself.runner_name), concludedcancelledand lasted at least the test jobs' 120-minute limit timed out. It fails the job, its batch and the run, and counts astimed_outin metrics.TEST_JOB_TIMEOUT_MINUTESis tested against both jobs intest-batch.yml. A shortercancelledjob is a genuine cancellation (Status.CANCELLED). Cancelled jobs that ran now get ajob.durationsample, so timed-out jobs show up in duration charts.ResultMetricinexecution_metrics.py), identical for batches and jobs:passed,failed,skipped,cancelled,inconclusive,timed_out. Each batch or job emits all six, exactly one of them 1.job.durationand the completion log.cancelled; otherwise a job failure outranks a timeout, which outranks the workflow's own conclusion.TaskTestGatherer.report_unfinished. On a cancellation, every batch and job without an outcome is countedcancelled, instead ofjobs.incomplete. Other shutdowns keepjobs.incomplete, excluding jobs whose outcome was already counted. Once stopping, the bus no longer delivers progress updates, so a job that finished in the last poll before a cancellation is countedcancelled.DispatcherProgress.has_failure: a failed batch, or a failed job in a batch that was not cancelled. A cancelled batch without failures makes the runcancelled. Cancelled batches and jobs render as🚫. The CLI aborts a cancelled run with "Dispatcher tests were cancelled." (same exit code).dispatcher.batch.idis no longer a metric tag. Batch IDs are plan positions (batch-00,batch-01, ...) and nothing queries metrics by them. The only metrics that needed the tag were thejobs.queuedandjobs.runninggauges, to keep concurrent batches from overwriting each other; the runner now emits their per-platform totals across in-flight batches instead.BatchFinished.timed_out(never set by the runner) with the gatherer branches andProgressError.TIMED_OUTit fed, and the gatherer's_status_by_batch/_results_by_batchregistries withWorkflowStatus. Tests that read the registries now assert the published progress or emitted metrics.The commit status that
test-batch.ymlposts is unchanged: GitHub commit statuses have nocancelledstate.Motivation
conclusion_to_statusmappedcancelledtoFAILURE, but GitHub usescancelledboth for a genuine cancellation and for a job that hittimeout-minutes. Job 110448952220 ran 120.4 minutes and reportsconclusion: cancelled; only its annotation says "The job has exceeded the maximum execution time of 2h0m0s". The job payload has nothing else that tells them apart, so this uses the duration.The cancellations worth reporting are the Dispatcher's own: once it is cancelled it stops polling, so GitHub never tells it how its batches ended. In the last 7 days, 6,753 of 6,951 incomplete jobs (97%) came from 28 cancelled Dispatcher runs; they are now counted as cancelled.
Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged