Skip to content

Retry a job whose "Run" step reported no conclusion - #115569

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/retry-infra-null-run-conclusion
Sep 20, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/retry-infra-null-run-conclusion

Conversation

@groeneai

@groeneai groeneai commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

retry_infra_failures.yml classifies each failed job as infrastructure-vs-real and re-runs the
workflow when all of them are infrastructure. The classifier had no arm for a Run step whose
conclusion is null, so it scored that job a real failure, and because the run-level gate
requires all verdicts true, one such job suppressed the retry for the whole run.

A null conclusion means GitHub finalized the job while its main step had never reported
(completed_at also null): the same "no verdict produced" class the adjacent length == 0 and
"skipped" arms already treat as infrastructure. A test that actually ran and failed reports
conclusion="failure" with both timestamps set, so this arm cannot absorb real failures.

Found on #114027 head 99c09b1b, where AST fuzzer (amd_debug, targeted, old_compatibility) was
killed mid-Run ("The self-hosted runner lost communication with the server"). It and two other
jobs reported failure having run zero tests and published zero CIDB rows. Why the runner went
away is not established and this PR asserts nothing about it: the logs are purged.

Validated against real captured job payloads, the jq extracted verbatim from the file in both arms:

  • Run 32270257975, 171 jobs:
    false true true -> should_rerun=false before, true true true -> true after. The false
    is exactly the killed job.
  • 60 recent failed pull_request.yml runs (10264 jobs, 158 failed): classification identical
    before and after. A 17-case matrix over the whole step-conclusion domain changes exactly one
    case, the intended one; cancelled is left alone.

Two limits worth stating. The state is rare: zero occurrences in those 60 runs. And this does not
recover the run that prompted it, which is attempt=3 while the workflow selects .attempt == 1
by design; widening that anti-loop bound is a separate question. MAX_RERUNS, the attempt gate and
the cutoff are unchanged.


Workflow [PR]
Sync PR [sync-upstream/pr/115569]

Version info

  • Merged into: 26.10.1.252-master (included in 26.10 and later)

retry_infra_failures.yml classifies each failed job as infrastructure-vs-real
and re-runs the workflow when all of them are infrastructure. The classifier
had no arm for a "Run" step whose conclusion is null, so it scored that job a
real failure; because the run-level gate requires every verdict to be true, one
such job suppressed the retry for the whole run.

A null conclusion means GitHub finalized the job while its main step had never
reported (completed_at is also null). That is the same "no verdict produced"
class the adjacent length == 0 and "skipped" arms already treat as
infrastructure. A test that actually ran and failed reports
conclusion="failure" with both timestamps set, so this arm cannot absorb real
failures.

Found on ClickHouse#114027 head 99c09b1, where AST fuzzer (amd_debug, targeted,
old_compatibility) was killed mid-Run on runner i-00c834ca4e798946f, with
GitHub's "The self-hosted runner lost communication with the server"
annotation. That job and two others reported failure having run zero tests and
published zero CIDB rows. Why the runner went away is not established: the job
logs are purged and its praktika report was never uploaded, so nothing here
asserts a mechanism for the death.

Validated against real captured job payloads, with the jq program extracted
verbatim from the file in both arms so they cannot diverge by transcription.
Run 32270257975 (171 jobs, captured paginated and asserted against
total_count): verdicts false/true/true -> should_rerun=false before, and
true/true/true -> should_rerun=true after, with the false attributable to
exactly the killed job. Over 60 recent failed pull_request.yml runs (10264
jobs, 158 failed, 0 null-Run instances) classification is identical before and
after, and a 17-case matrix across the whole step-conclusion domain changes
exactly one case, the intended one; "cancelled" is deliberately left alone.

The state is rare: zero occurrences in those 60 runs. This also does not
recover the run that prompted it, which is attempt=3 while the workflow selects
.attempt == 1 by design; widening that anti-loop bound is a separate question
with a different risk profile. MAX_RERUNS, the attempt gate and the 6 hour
cutoff are unchanged, as is the job filter feeding the classifier.

Co-Authored-By: Claude Fable 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect labels Aug 20, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (0 blockers, 0 majors, 3 nits, all resolved)

I reviewed this change cold against the code before reading the implementation
notes, then ran an independent second-model gate over the same diff. The gate
returned 0 findings. My own review returned 3 nits, all of which I then
refuted or documented; none required a change.

The one risk worth attacking here is that widening an infra classifier could
absorb a real failure and auto-retry a genuine bug. I attacked it four ways
and it held.

A genuine hang does not look like this. Across 16,019 jobs including
cancelled runs, Run.conclusion among non-success terminal jobs is failure
(152), absent (67), cancelled (245 + 182) or success (5). null appears in
none of them. The longest failed job anywhere is 301 min (BuzzHouse (amd_debug)) and it reports conclusion="failure"; nothing approaches the
360/485-minute job limits. A synthetic timed_out spanning six hours still
classifies as a real failure after the change.

Ordinary failures are untouched. 19,281 jobs across 120 failed runs (60
pull_request.yml + 60 master.yml), 283 failed jobs, Run conclusion
distribution {failure: 283} and zero null. A second independent pass over 50
failed PR runs: 8,555 jobs, 131 failed, zero null.

The probe is not vacuous and the base arm is not a strawman. I re-fetched
the incident payload rather than reusing the captured one: base gives
false true true and so suppresses the retry, the change gives true true true
and fires it. repro/base.yml is byte-identical to git show <merge-base>: of
the file. Re-running the 17-case matrix against that true base flips exactly one
verdict, the intended one; cancelled, neutral, timed_out,
action_required and success are all unchanged.

Two details that are load-bearing and easy to miss:

  • Arm order matters for correctness, not style. fromdateiso8601 on the
    null completed_at raises strptime/1 requires string inputs, which under
    set -euo pipefail would abort the step. Placing the new arm before the
    failure arm is what avoids that.
  • null is durable, so this is not inert. The incident job completed at
    22:59:09Z and still reported status=in_progress, conclusion=null, completed_at=null when re-read 3h12m later. GitHub does not backfill it, so
    the hourly cron will observe the state.

Structurally: the classifier exists in exactly one file repo-wide;
retry_infra_failures.yml is one of seven hand-written workflows with no
ci/workflows/*.py source, so the praktika up-to-date check cannot conflict
with this edit; and both downstream consumers are gated on
should_rerun == false, so returning true earlier can only skip them, never
mis-drive them. MAX_RERUNS, the .attempt == 1 selector, the six-hour cutoff
and the job filter are all outside the diff.

💡 Nit, noted and not blocking: no automated test guards the new arm. A
text-level guard would be feasible (ci/tests/test_auto_releases.py reads a
workflow YAML as text), but it would pin a string rather than behaviour, and a
behavioural test needs the jq lifted out of the YAML. All 15 prior commits to
this file, including four classifier repairs, added no tests, so validation here
is deterministic against real captured API payloads instead.

Two nits I raised and then refuted myself: the linked-issue line sits inside the
HTML comment, which is what the current upstream template prescribes and what 12
of 12 recent merged PRs do; and the description's account of the incident is
accurate about only one of the three failed jobs carrying this shape.

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Aug 20, 2026
@clickhouse-gh clickhouse-gh Bot closed this Aug 20, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Aug 20, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate
# Check Answer
a Deterministic repro? Yes. ./gate.sh <yml> jobs.json over the captured 171-job payload of run 32270257975, fully reproducible, no server and no timing dependence. The payload is captured paginated and asserted 171 == total_count (the unpaginated call returns only 30 jobs).
b Root cause explained? Yes. A Run step with conclusion: null fell through the classifier chain to false; the run-level gate requires every verdict to be true, so that one job suppressed the retry for all three failed jobs in the run.
c Fix matches root cause? Yes. The missing arm is added in the layer that already owns infra-vs-real classification. No bound widened, no threshold relaxed, no detection weakened.
d Test intent preserved / tests added? Preserved: real-failure detection is provably unchanged over 158 real failed jobs and 16 of 17 matrix cases. No in-repo test added, because the change is a jq expression inside a GitHub Actions cron and ci/tests/ covers praktika Python, not .github/workflows/** shell. Validation is instead deterministic against real captured API payloads.
e Both directions demonstrated? Yes. Same input, program extracted verbatim from each yml: base false true true -> should_rerun=false; fixed true true true -> should_rerun=true. The false is attributable to exactly the killed job.
f General across code paths? Yes. grep -rln 'select(.name == "Run")' finds no sibling copy of the classifier. Both downstream consumers of the same job data (the Praktika-results fallback and the Config Workflow re-check) run only when should_rerun is still false, so returning true earlier can only skip them, never mis-drive them.
g Generalizes across inputs? Yes. A 17-case matrix over the whole GitHub step-conclusion domain (null, success, failure, skipped, cancelled, neutral, timed_out, action_required) x two duration regimes, plus the no-Run-step and plumbing-job shapes: exactly one case changes, the intended one. cancelled deliberately stays false.
h Backward compatible? Yes. No setting, no serialization format, no user-visible behavior, so no SettingsChangesHistory.cpp obligation. The only delta is that one previously-unhandled infra state now retries, on first-attempt runs only.
i Invariants and contracts preserved? Yes. MAX_RERUNS=10, the .attempt == 1 selector and the 6 hour cutoff are all outside the diff and verified untouched. The select(.conclusion == "failure") job filter is unchanged, so the set of jobs entering the classifier is unchanged, as is the all-true run gate.

Negative control (the arm that proves this is not a blanket "retry everything"): 60 recent failed
pull_request.yml runs, captured paginated with a total_count assertion each (0 truncations),
10264 jobs and 158 failed jobs, containing 0 null-Run instances. Both arms classify all 60 runs
identically. The harness itself is sensitivity-checked: corrupting the extraction marker makes it
exit rc=3 rather than silently reporting agreement.

@clickhouse-gh

clickhouse-gh Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f919b88]

Summary: ✅


AI Review

Summary

The PR updates .github/workflows/retry_infra_failures.yml so a failed job whose Run step never produced a conclusion is treated like the existing "no Run step" / "skipped" infrastructure cases and becomes eligible for an automatic rerun. I did not find an actionable correctness, safety, or PR-metadata issue in the current patch after reviewing the current workflow logic, the PR discussion, and the relevant praktika execution path.

Final Verdict

✅ No actionable findings.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 20, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @leshikus, could you review this? The infra-vs-real job classifier in retry_infra_failures.yml had no arm for a Run step whose conclusion is null (GitHub finalized the job while its main step never reported), so it scored that job a real failure and, because the run gate requires every verdict true, one such job suppressed the retry for the whole run.

@clickhouse-gh

clickhouse-gh Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing f919b88a3 with master d62a974e8 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of bcb7844b4; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 703.90 MiB 701.32 MiB -2.58 MiB (-0.37%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Symbol sizes
Binary Symbol Master PR Δ
programs/clickhouse-keeper ProfileEvents::global_counters_storage 11.31 MiB 11.62 MiB +320.00 KiB (+2.76%)
programs/clickhouse ProfileEvents::global_counters_storage 11.31 MiB 11.62 MiB +320.00 KiB (+2.76%)

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - f919b88

CI is fully finished on this head and no check failed, so the table below has no rows
and nothing needs an owner.

Check / test Reason Owner / fixing PR

Measured on the deduplicated check-run set (newest attempt per name): 173 unique
names, 0 incomplete, 0 non-green. Config Workflow, Style check and
Finish Workflow all succeeded, so this is a real run rather than a void one.
14 jobs ran and passed: 3 builds, 6 stateless legs, Style check, Code Review,
Build profile diff, Config Workflow and Finish Workflow. The other 157 were
skipped by the selected-tests gate, which is expected for a change touching only
.github/workflows/retry_infra_failures.yml. CIDB agrees independently: 53 OK
rows and 0 FAIL or ERROR rows for this pull request.

One caveat for anyone re-reading the raw check list: two runs look non-green there
(Config Workflow and request-reviews-fork, both cancelled at 08:40:57Z). Both
are superseded earlier attempts of names that subsequently succeeded or were skipped,
so neither is a failure.

Scope reminder from the PR body, repeated here so the green result is not
over-read: this change would not have rescued the head that motivated it, because
the retry workflow selects .attempt == 1 by design and that run was already on
attempt 3. The separate operational action on the affected pull request is a manual
re-run of the three killed jobs.

Session id: cron:our-pr-ci-monitor:20260820-103000

@alexey-milovidov alexey-milovidov self-assigned this Sep 19, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 19, 2026
Merged via the queue into ClickHouse:master with commit 4493c44 Sep 20, 2026
185 of 187 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect manual approve Manual approve required to run CI pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants