Skip to content

CI: retry transient GitHub API failures in the Build profile diff master walk - #125807

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:build-profile-diff-retry-commits-walk
Oct 19, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:build-profile-diff-retry-commits-walk

Conversation

@groeneai

@groeneai groeneai commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #115201

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

Build profile diff errors when a single gh api repos/ClickHouse/ClickHouse/commits call of its master first-parent walk fails: HTTP 503 on #124959 and #125328, unexpected end of JSON input on #122585, HTTP 504 on #119371. CIDB has 9 such jobs on 9 PRs since 2026-10-03.

These are single-request blips: _list_commits_page raised on the first failure and the walk makes ~20 calls per job. In 7 of the 9 the failing anchor sits 11-15 days deep in a walk whose earlier fetches had just succeeded, and the same commits passed on other runs.

The listing is now retried up to 3 times (after 5 s, then 10 s), keeping the 120 s per-call timeout. A timeout, an HTTP 5xx or 429, or a failure that names no HTTP status (a cut response) is retried; any other 4xx fails at once. A failure that outlasts the retries still fails the job, as the walk's fail-close contract requires. praktika's retrying GH helpers are not reused: they pass no subprocess timeout, which #115201 kept on purpose.

Validated locally with a fake gh replaying the CI error strings in front of the real one (every transient class recovers, a 404 fails after one call, three 503s raise the last error), and against GitHub: the walk over the #124959 window returns the same 1547 commits as before.


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

Version info

  • Merged into: 26.11.1.198-master (included in 26.11 and later)

…ter walk

`_list_commits_page` ran one `gh api repos/ClickHouse/ClickHouse/commits`
call and raised on the first non-zero exit or timeout, and the per-TU
master first-parent walk makes ~20 such calls per job. GitHub fails single
requests (HTTP 503 and 504, a body cut short so `--jq` reports `unexpected
end of JSON input`, a stalled body) while the requests around them succeed,
so one blip errored the whole check: 9 jobs on 9 PRs between 2026-10-03 and
2026-10-14, the failing anchors 11-15 days deep in walks whose earlier
fetches had just succeeded, and the same commits passing on other runs.

Retry the listing up to 3 times (after 5 s, then 10 s), keeping the 120 s
per-call timeout. A timeout, an HTTP 5xx or 429, or a failure whose stderr
names no HTTP status is retried; any other 4xx (unknown sha, permissions)
fails at once, since `gh` reports an HTTP error as `gh: <message> (HTTP
<status>)`. After the last attempt the error propagates as before, so the
walk stays fail-close as the `extend_master_shas` docstring requires. The
praktika `GH` helpers retry but pass no subprocess timeout, which ClickHouse#115201
kept on this call site on purpose.

CI reports:
- https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=124959&sha=1d61eebf3fe5ed809d4811ea947169074a3e1712&name_0=PR&name_1=Build%20profile%20diff
  (ClickHouse#124959)
- https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125328&sha=ab772cc3b97c2e6777f2ef60723bcbeb5a5f29e3&name_0=PR&name_1=Build%20profile%20diff
  (ClickHouse#125328)
- https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=122585&sha=bf8b2d2470663e1b5703c2014b7887fe2d5dd239&name_0=PR&name_1=Build%20profile%20diff
  (ClickHouse#122585)
- https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119371&sha=88edddd16dcd4250ac56e1642f964a03763097f4&name_0=PR&name_1=Build%20profile%20diff
  (ClickHouse#119371)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (3 nits, no blocker or major).

# Sev Finding Verdict Evidence / action
1 💡 "Failing anchors 11-15 days deep" holds for 7 of the 9 jobs, not all AGREE PR description reworded; commit message left as is
2 💡 raise error drops the TimeoutExpired exception chain AGREE not changed: the message still names the 120 s timeout
3 💡 Worst case per listing grows from 120 s to 375 s under a persistent stall AGREE not changed: only a compound cluster-plus-GitHub outage reaches the 1800 s job timeout; a persistent failure still fails the job

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding.

Session id: cron:clickhouse-review-slot-9:20261014-135500

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @leshikus, could you review this? _list_commits_page now retries a timeout, an HTTP 5xx or 429, or a failure without an HTTP status up to 3 times (after 5 s, then 10 s), so one failed GitHub request no longer errors Build profile diff; a persistent failure still fails the job.

@clickhouse-gh

clickhouse-gh Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0b4fff1]

Summary: ✅


AI Review

Summary

Adds bounded retries to _list_commits_page for transient GitHub API failures while preserving the per-call timeout and propagating persistent errors. Reviewed head 0b4fff1297d4659ad6fb6ab0bf3a47622083cf7d, the complete modified file, callers, and prior discussion. No actionable findings; nine focused local tests passed, including transient recovery, permanent errors, retry exhaustion, and master-chain error propagation.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Oct 14, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Oct 15, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 19, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 19, 2026
Merged via the queue into ClickHouse:master with commit 579f4da Oct 19, 2026
523 of 525 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 19, 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). 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