Repository navigation
fix(source-control): retry the verdict reader's artifact listing on transient errors - #7738
Conversation
…ransient errors A transient failure of the pr-merge verdict reader's artifact listing (no HTTP response, a 5xx, a 429, or a 403 naming a rate limit) is read again, three reads in all with 2s and 4s backoff, before it refuses verify:unreadable. Any other failure refuses at once, and a listing that fails every read refuses exactly as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QRBud9mEJLtwtT71MG8bMB
…retry timeouts A 429 or rate-limit 403 now refuses on the first read, since a fixed short wait outlasts neither a Retry-After nor an hourly reset. A failure with no HTTP status counts as transient only for a gh timeout or a known network error, so a missing gh or missing credentials are not retried. Each retry read gets a 15s timeout; the first keeps gh's default. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QRBud9mEJLtwtT71MG8bMB
A timed-out listing is no longer read again. Retries after a 5xx or a fast network error share a deadline of one gh timeout from the first read, so the listing's worst case per gate run stays at a single read's timeout. The retry loop returns from a helper, so no variable is left unbound. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QRBud9mEJLtwtT71MG8bMB
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 1m 58s —— View job Security review complete
Scope reviewed: the 4 changed files ( Findings: none. This PR adds a bounded retry (3 reads max, waits
No instruction-surface deletions in this diff (the docstring and claude-lane-summary: lane=claude-security-review sha=7ddb0195a754dba9f60112ea40686e0e79503fad run=39052164778 |
|
Claude finished @kyle-sexton's task in 3m 24s —— View job Claude's review of PR #7738
Scope reviewed: Findings: none. I traced the retry/deadline arithmetic in Other checks that came back clean:
No inline comments were needed. claude-lane-summary: lane=claude-review sha=7ddb0195a754dba9f60112ea40686e0e79503fad run=39052164424 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ddb0195a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-security-review has reviewed this pull request through 1480ed2; a later push is reviewed from there. |
|
claude-review has reviewed this pull request through 1480ed2; a later push is reviewed from there. |
…ckoff sleep The retry timeout was derived before the sleep, so a late-returning sleep let the retry run past the shared deadline. Read the clock again after the sleep and skip the retry when the deadline has passed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
|
Claude finished @kyle-sexton's task in 1m 3s —— View job Security review (incremental, since
|
|
Claude finished @kyle-sexton's task in 1m 57s —— View job Claude's review of PR #7738 (incremental)
Scope reviewed: only what changed since Findings: none. I hand-traced
The two-gate structure (check-before-sleep to avoid wasting a wait when already doomed, recompute-after-sleep to not trust a stale pre-sleep estimate) is consistent and leaves no unbound- I was not able to execute the test suite in this sandbox (Bash commands here require interactive approval that isn't available to this lane), so this is a manual trace against the test bodies, not an executed run — consistent with the confidence basis in this lane's prior review of the file. No inline comments were needed. claude-lane-summary: lane=claude-review sha=1480ed221215d1aecbae4b29de407d289bed8424 run=39055656092 |
Refs: #7718
Summary
The pr-merge verdict reader (
babysit_verify_evidence.py, added in #7718) lists every repository artifact once per gate run. Until now any failure of that listing refused the pull requestverify:unreadableat once, so a single 502 or dropped connection held the candidate for that run. This reads the listing again when the failure is one that a retry can clear.Fix
_actionsraises_Transient(a subclass of_Unreadable) only for:babysit_gh.gh_http_statusparse;NETWORK_ERRORS: gh's "error connecting to", and Go net/http's connection reset/refused, i/o timeout, TLS handshake timeout, unexpected EOF)._read_listingreads, then retries after each ofLISTING_WAITS = (2.0, 4.0). All reads and waits share one deadline: one gh timeout (babysit_gh.gh_timeout_seconds(), 60s by default) from the first read. Each retry'stimeout_secondsis the time left after its wait, and no retry runs once none is left._listing_sleepand_listing_clock, patchable likebabysit_merge._poll_sleep/_poll_clock.verify:unreadablewithout paging again. A retry never turns a failure into a pass.docs/conventions/pr-pipeline/README.mddescribe the retry.Verification
tests/test_babysit_verify_evidence.py: 84 passed, 77 subtests. New classATransientListingFailureIsReadAgain:verify:unreadableafter 3 reads with waits[2.0, 4.0];[None, 57.0, 36.0];Resource not accessible by integration (HTTP 403), 429, a secondary-rate-limit 403, a primary-rate-limit 403, the no-credential message and gh missing from PATH are each read once with no wait.test_a_failed_listing_refuses_every_entry_and_is_not_read_per_entryexpects 3 listing calls for its 502 outage: one listing per run, retried, never one per entry.scripts/check-affected.sh: 7 passed, 1 skipped over 4 changed files.pyright(the repo's strict config) reports no unbound-variable diagnostic for the file. No CI step runs pyright over it:.github/standards/pyright/pyrightconfig.jsonappears only as a managed file inpr-check-managed-files-hosted.yml.Latency arithmetic. pr-merge.yml runs the gate once per candidate, each with its own
Reader, inside a 30-minute job (timeout-minutes: 30). gh's default timeout is 60s (babysit_util.DEFAULT_COMMAND_TIMEOUT_SECONDS).The retry never raises a candidate's listing worst case above today's single-read timeout. Rate limits are not retried.
Related
tests/test_babysit_verify_evidence.py. The new tests sit in one block before the--authority pr-mergesection. Outside that block, one existing test inTheListingIsReadOncePerReaderis renamed and its assertion changed, so a merge conflict stays small. The block'ssetUpModulepatches_listing_sleepso no test in the file sleeps.🤖 Generated with Claude Code
https://claude.ai/code/session_01QRBud9mEJLtwtT71MG8bMB