Repository navigation
Retry a job image pull that failed DNS resolution - #115555
alexey-milovidov merged 1 commit into
Conversation
The retried job image pull added in ClickHouse#113611 declined to retry a DNS resolution failure, because the phrase Go's resolver emits for a SERVFAIL was not in `_IMAGE_PULL_RETRY_ERRORS`. The pull stopped after one attempt, its non-fatal failure fell through to the implicit `docker run` pull, which has no retry wrapper, and the whole job aborted with zero tests run. Verbatim from a failing job's own log: Run command: [timeout --verbose 300 docker pull clickhouse/stateless-test:...] failed to copy: httpReadSeeker: failed open: failed to do request: Get ".../blobs/sha256:180a6c67...": dial tcp: lookup dockerhub-proxy.dockerhub-proxy-zone on 127.0.0.53:53: server misbehaving Retry 1/3: command failed, exit code: 1 No retryable errors found, stopping retries ERROR: command failed after 1/3 attempt(s), exit code: 1 Measured over 30 days: 4 jobs across 4 pull requests, none on master, and every one of the four carries this phrase in the pull's own stderr. Each produced zero test rows while sibling jobs on the same commit produced 55 to 950, so a whole check is forfeited rather than a single test. `server misbehaving` means a nameserver was reached and answered badly, so the same name can resolve on a later attempt. Its NXDOMAIN sibling `no such host` is not added: that verdict is permanent, so a misnamed image host would burn all three attempts instead of failing fast. It also has zero occurrences in 90 days. Matching a broader substring such as `dial tcp` or `lookup ` was rejected for the same reason, since both prefix NXDOMAIN too. The two errors in that log differ, which is what makes the gap look already covered: the retried attempt got `server misbehaving` while the later `docker run` got `connection refused`, which is in the allowlist but by then no retry wrapper is in play. Only the second error reaches the CI database, so the pull's own error is visible only in the job log. Tests: the new phrase joins the parametrized arm that pins every transport entry as load-bearing, and a new arm feeds the verbatim production line rather than a bare phrase, since there the phrase is the tail of a nested resolver error inside a URL. That arm carries its own control, the same line against the allowlist with the entry removed, which must stop after one attempt; without it the arm could not distinguish this entry working from some other entry matching. A further arm pins that the NXDOMAIN line is still not retried, which fails if the entry is ever widened.
Internal second-model review (click to expand)An independent model reviewed this diff cold against the code and the frozen PR body, and I
No blocker or major finding in either review. The final gate ran clean on the frozen body. Two things I verified independently rather than taking from the author, because both are load
The new arms are not decorative. Deleting the entry reddens exactly the two arms that pin it, on |
Pre-PR validation gate (click to expand)
Mutation coverage, measured on a disposable copy: deleting the entry reddens exactly the 2 arms that pin it and no others, failing on the attempt count ( Session id: cron:clickhouse-impl-slot-6:20260820-043600 |
|
Workflow [PR], commit [0577039] Summary: ✅ AI ReviewSummaryThis PR adds Go's Missing context / blind spots
Final Verdict✅ No blocking or major issues found. |
|
cc @maxknv, could you review this? It is a one-phrase follow-up to #113611, which you approved: the pull retry it added declines a DNS SERVFAIL, because Go's resolver renders that as |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
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 units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
4007336
Related: #113611
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Retry the praktika job's Docker image pull when the registry proxy's name fails to resolve, so a transient DNS failure no longer kills the whole job before any test runs.
Description
The retried job image pull added in #113611 declines to retry a DNS resolution failure, so the job aborts with zero tests run. From a failing job's log:
Root cause.
_IMAGE_PULL_RETRY_ERRORSallowlists transport-class phrases. Go's resolver renders a SERVFAIL asserver misbehaving, absent from that list, so a transient DNS blip takes thebreakpath meant for permanent errors and the pull's non-fatal failure falls through to the implicitdocker runpull, which has no retry wrapper.The change adds that one phrase: a nameserver was reached and answered badly, so the same name can resolve on a later attempt.
no such hostis deliberately not added: that is NXDOMAIN, i.e. permanent, so a misnamed image host would burn all three attempts instead of failing fast, and it has 0 occurrences in 90 days. A broader substring (dial tcp,lookup) was rejected for the same reason, since both prefix NXDOMAIN too. A new arm pins that the NXDOMAIN line is still not retried.Breadth. 4 jobs across 4 pull requests in 30 days, 0 on master, each carrying this phrase in the pull's own stderr. Each produced 0 test rows while sibling jobs on the same commit produced 55 to 950, so a whole check is lost, not one test.
Validation. The suite drives the real
Shell.runloop, so its arms exercise the production matcher. Without the fix the new arms report 1 attempt instead of 3; with it, 25 passed, identical over 30 runs.No related open issue found.
New test arms and their controls
The new arm feeds the verbatim production line rather than a bare phrase, because there the phrase is the tail of a nested resolver error inside a URL. It carries its own negative control: the same line matched against the allowlist with the entry removed must stop after one attempt. Without that control the arm could not distinguish this entry working from some other entry already matching, which is what the pre-fix job disproved by stopping after attempt 1.
Note also that the two errors in the log above differ, which is why the gap looks covered: the retried attempt got
server misbehaving, the laterdocker rungot the allowlistedconnection refused, by which point no retry wrapper is in play. Only the second reaches the CI database, so the pull's own error appears only in the job log.test_each_transport_phrase_is_retried[server misbehaving]test_the_production_dns_failure_is_retriedon_retryreports the phrasetest_the_permanent_resolver_failure_is_not_retried(no such host)test_permanent_error_is_not_retried,test_named_permanent_errors_are_not_retriedDeleting the entry reddens exactly the 2 arms that pin it and no others; widening it to
dial tcpreddens the NXDOMAIN arm, so that arm is load-bearing rather than decorative.Workflow [PR]
Sync PR [sync-upstream/pr/115555]