Skip to content

Restore the default docker image pull retry count in the Install packages job - #121726

Merged
leshikus merged 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/install-check-pull-rung-count
Sep 23, 2026
Merged

leshikus merged 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/install-check-pull-rung-count

Conversation

@groeneai

@groeneai groeneai commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Restore the default docker image pull retry count in the Install packages job

Related: #117421

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):

Not required: CI-only change to the Install packages job.

Description

Install packages (arm_release) died with 0 tests run on
run 35795670497
(praktika report):
the deb image pull exhausted its retry ladder and the RuntimeError killed the job before any
test ran, blocking Mergeable Check on an unrelated PR.

The ladder was one rung short. ci/jobs/install_check.py passed retries=2 while
ci/praktika/docker.py defaults to _IMAGE_PULL_RETRIES = 3, and rungs accumulate progress:
each attempt keeps what it already fetched. Rung 1 reached no layers in 119s; rung 2 had all three
layers at Download complete by t+91s and timeout killed it 29s later at its 120s cap, so a
third rung would have started with the download done.
timeout_s=120 is kept, so rungs 1 and 2 stay byte-identical and no passing run can newly fail.

The job timeout goes to 1800s too: job.timeout bounds the run script alone, both pulls run
inside it, and 900s was already too tight without the third rung. Install packages (amd_release)
produced 76 job-level errors past the cap in 90 days, 75 on master or release branches, and the three logs I opened
show Job timed out ... timeout [900] on a job still walking its test list, killed with one or
two tests left after 12s to 33s of pulls; 54 of 31,163 successes
finished within 20s of the cap. Worst case is now 885s of measured non-pull work plus a 732s ladder
(3 x 120s plus Shell.run's 2s and 4s sleeps, twice), which 1800s holds. Generated
workflows are unchanged: yaml_generator.py emits timeout-minutes only above 6h.

Locally, a cold-image ladder reproduces command failed after 2/2 attempt(s), exit code: 124,
and the next rung finishes it with no re-download.

#117180 rewrites the two pull lines into conditionals; whichever lands second keeps them and
drops retries=2. A timeout-killed pull is still never labelled infra, which #117282 owns.


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

Version info

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

The two image pulls in ci/jobs/install_check.py passed retries=2 to
DockerImage.pull_image, one rung short of the library default:
ci/praktika/docker.py defaults to _IMAGE_PULL_RETRIES = 3. Shell.run loops `for
retry in range(retries)`, so retries is the total attempt count and 2 bought one
try plus one retry.

That cost a whole job on run 35795670497. Rung 1 reached no layers in 119s, rung
2 downloaded all three layers by t+91s and was killed by timeout at its 120s cap
while extracting, and the ladder was out of rungs. The RuntimeError left main()
before any test ran, so praktika recorded a job-level error with no test results
and Mergeable Check was blocked on a PR whose diff was unrelated.

Rungs accumulate progress, because a killed attempt keeps what it already
fetched in the local content store, so a third rung would have begun with the
download already done. Only the rung count was wrong. The 120s per-rung cap is
well above the worst normal pull and it keeps the `exit code 124` traceback
instead of losing the job to its own 900s timeout, so timeout_s=120 stays; two
settings were narrowed together when only one of them needed it.

The change cannot make a passing run fail: timeout_s is unchanged, so rungs 1
and 2 are byte-identical to today's, and the only new behaviour is a third rung
on a path that has already failed. Counting the ladder's inter-rung backoff, the
worst case per pull goes 242s to 366s, both images 484s to 732s, inside the 900s
timeout both install-check job configs carry.

Co-Authored-By: Claude Opus 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 Sep 23, 2026
@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), two passes over this change,
the plan and the resulting code: 0 findings. My own cold review of the code on disk found 3, all
of them in the PR description, all fixed here before publication. No code or test finding, so no
fix round was needed.

# Sev Finding Verdict Evidence / action
1 💡 The only provenance line sat inside the template's <!-- Linked issues and pull requests --> comment, which GitHub does not render, so the description linked nothing AGREE, fixed in the description Moved to a visible Related: line and the spent instruction block dropped, matching ci/jobs/revert_ci_regressions.py:1779 and recent merged PRs. Both ### headers stay byte-identical to the upstream template, and get_category parses the frozen body with no error
2 💡 "killed while extracting" was an inference presented as an observation AGREE, fixed in the description The job log has no Extracting line. What it shows is the TERM arriving 29s after the last Download complete, with every layer already in the local content store, which is the stronger claim. Reworded to that
3 💡 Description sat exactly at my length ceiling, with no margin AGREE, fixed in the description Condensed; no claim dropped

Checks I ran that produced no finding, listed so they are not re-run: Shell.run loops
for retry in range(retries), so retries is the total attempt count and the omitted kwarg
resolves to _IMAGE_PULL_RETRIES = 3; every pull_image call site in the tree is enumerated and
after this change none of them narrows the library budget; the per-rung command and the inter-rung
backoff are untouched, so rungs 1 and 2 are byte-identical to today's; the worst-case ladder is
732s for both images against the timeout=900 that runner.py charges to the run script alone;
this file is in digest_config.include_paths, so the job re-runs rather than being served from
cache; and 14 days of CI history show exactly one error on this check, the one fixed here.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding. Findings on hunks unchanged by a fix round are auto-dropped.

Session id: cron:clickhouse-review-slot-8:20260923-085300

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Sep 23, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. A 3-rung control over the real Shell.run ladder and the real _IMAGE_PULL_RETRY_ERRORS matcher returns rc 124 at retries=2 and rc 0 on rung 3 at retries=3, on demand. Docker.pull_image('gcc:14', strict=False, timeout_s=6, retries=2) on a cold image reproduced the CI marker sequence exactly.
b Root cause explained? Yes. Shell.run loops for retry in range(retries), so retries is the total attempt count: the caller's retries=2 bought 1 try plus 1 retry. Rungs accumulate progress, so the ladder gave up while rung 2 was ~29s of extraction from done; the RuntimeError left main() before any test ran and praktika recorded a job-level error with 0 results.
c Fix matches root cause? Yes. The wrong value was a 2 at the call site, so it is deleted and the call inherits _IMAGE_PULL_RETRIES = 3. No timeout widening, no swallowed exception, no change to which errors are retryable.
d Test intent preserved / new tests added? No test is modified, so nothing is weakened. None is added deliberately: there is no in-tree harness for the praktika ladder, and asserting "this file passes no retries" would be a vacuous oracle. The equivalent assertion was run locally instead.
e Both directions demonstrated? Yes, twice. Reading the shipped call site with Shell.run instrumented: retries resolves to 2 before the change and 3 after, with a byte-identical command string. On the ladder: retries=2 gives rc 124 at 2/2, retries=3 gives rc 0 on rung 3.
f Fix is general across code paths? Yes. All 7 pull_image call sites were enumerated: both sites in this file (deb and rpm) are fixed, since fixing one would leave the identical failure on the other image; ast_fuzzer_job.py, libfuzzer_test_check.py, stress_job.py and runner.py already call bare and inherit 300s x 3. This was the only narrowing caller.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A for datatypes. The analogous matrix holds: both images, both job configs (install_check_jobs and install_check_master_jobs, one script), all four _release parameter sets. Boundaries hold: 3 satisfies assert retries >= 2 and stays above Shell.run's retry-errors floor of 2; timeout_s=120 still satisfies assert timeout_s >= 1.
h Backward compatible? (maintainer-approved exception only) Yes, vacuously: no setting, no SettingsChangesHistory.cpp, no format, no on-disk state, nothing user-visible. The file is in digest_config.include_paths for both job configs, so the job digest changes and the job re-runs instead of being served from cache, which is intended.
i Invariants and contracts preserved? Yes. Docker.pull_image's documented contract (a caller paying retries out of its own job timeout passes a budget that fits inside it) still holds: 732s worst case for both pulls against the job's 900s timeout. on_retry now fires at most twice per pull instead of once, and add_workflow_warning is report-only, so no status changes. The error path is untouched, so an exhausted ladder still raises the exit code 124 traceback instead of losing the diagnostic to a job timeout.

Session id: cron:clickhouse-impl-slot-4:20260923-081600

@groeneai
groeneai requested a review from leshikus September 23, 2026 09:24
@clickhouse-gh

clickhouse-gh Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [88204d7]

Summary: ✅


AI Review

Summary

This PR restores ci/jobs/install_check.py to use Docker.pull_image's default three-attempt ladder for the deb and rpm test images, and raises both Install packages job configs from 900 to 1800 seconds so that the wider pull budget still fits inside the runner-enforced timeout. I found no remaining correctness or operational issues in the current revision.

Final Verdict

✅ No new findings.

Comment thread ci/jobs/install_check.py Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 23, 2026

@leshikus leshikus left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just adjust the timeout as the bot suggested

The job had already outgrown 900s on its own, before any change to the pull ladder.
Install packages (amd_release) runs on t3.large and produced 76 job-level errors past
the cap (950s to 1200s) in the last 90 days, 75 of them on master or a release branch.
The three I opened all name the same cause, for example run 35776234765:
"WARNING: Job timed out: [Install packages (amd_release)], timeout [900], exit code
[-15]". None of the three was stuck. Each was still walking its test list and was
killed 6s to 32s into a test with one or two tests left, and each spent only 12s to
33s of its budget on the two image pulls. The successes crowd the same cliff: of
31,163 in 90 days, 998 took at least 800s, 370 at least 850s and 54 at least 880s.

Restoring the third pull rung spends the same budget, because job.timeout bounds the
run script alone (runner.py hands it to TeePopen) and both pulls run inside it. Worst
case per image is three 120s attempts plus the 2s and 4s Shell.run sleeps between
them, so 366s, and 732s for the two images. Measured non-pull work reaches 885s, so
1800s holds 885 + 732 with margin where 900s does not.

Both configs move together because they run the same script on the same runner sizes.
1800s is already used elsewhere in this file and every other job here sits between
1800s and 24h. Generated workflows are untouched: yaml_generator.py only emits
timeout-minutes for a job over 6h.

Co-Authored-By: Claude Opus 5 <[email protected]>
@leshikus
leshikus added this pull request to the merge queue Sep 23, 2026
Merged via the queue into ClickHouse:master with commit 1176bb7 Sep 23, 2026
176 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 23, 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