fix(ci): ride out transient registry blips in nightly image pulls#191
Merged
Conversation
The Linux nightly fresh-host job failed intermittently when 'docker pull' could not reach registry-1.docker.io ('context deadline exceeded' / 'request canceled while waiting for connection'). These registry network timeouts were not classified as transient, so the pull helper retried them with the short generic backoff (2s, 4s) and burned its retry budget within seconds.
Classify registry connectivity timeouts as a distinct transient failure and apply a longer, capped exponential backoff (10s, 20s, 40s, 45s) so a brief upstream outage is ridden out across the retry budget. Raise the Linux fresh-host pull retry budget to 5 so the backoff has room to work. Add unit coverage for the new backoff schedule.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The nightly Linux Fresh Host job has been failing intermittently. RCA of the latest failed run (
27669020598) showed theensure-imagesprepull step exiting 1 with every image dying at the same ~15s wall:That ~15s is the Docker daemon's own registry HTTP client timeout reaching Docker Hub — i.e. a transient registry connectivity blip, not a daemon fault. The pull helper already retries, but these registry timeouts were not recognized as a distinct transient class, so they fell through to the short generic backoff (
2s,4s) and exhausted the retry budget within seconds — explaining the pass/fail/pass flakiness.Changes
context deadline exceeded,request canceled while waiting for connection,i/o timeout,tls handshake timeout, DNS errors, …) as a separate retry class from daemon-connectivity faults, in the hosted-docker pull helper.10s → 20s → 40s → 45s) so a brief upstream outage is ridden out across the retry budget instead of being burned in a few seconds. Generic failures keep the existing short backoff.Local:
38 passed, 4 skipped(hosted-docker unit + CI workflow contract suites); ruff lint/format and mypy clean on the changed files.Note (not addressed here)
The Linux fresh-host job reads the pull knobs from the top-level workflow
env, so it ignores the per-callerdocker_pull_*inputs (only the macOS job wires them through). Bumping the budget therefore lives in the sharedenv. Wiring the Linux job to honor per-caller inputs is a reasonable follow-up but is out of scope for this fix.