Repository navigation
Retry transient transport failures of git reads of origin - #915
Merged
Merged
Conversation
An ls-remote or fetch whose git error says the connection to origin failed in transport (a dropped HTTP/2 stream, reset, timeout, name lookup, TLS read, HTTP 429/5xx) is run up to three times, one then two seconds apart, with a progress line per retry. Permanent and unclassified failures, and every push, are attempted once. Interruption ends the wait at once; the lock-wait retry is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A missing ref or remote reported alongside a hang-up is permanent, so it is fetched once. Interruption::pause serves both the gh and git read retries. The remote-read predicate is renamed reads_remote, and the integration test installs its upload-pack through a child process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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
Git reads of origin (
ls-remote,fetch) that fail in transport are now tried again, within a short budget, instead of failing the Pass. Every caller the issue names goes throughGit::run/run_checked, so each one is covered: Issue branch selection, Pickup's reservation check, Worktree ownership checks, the remote-head probe and fetches.docs/guide.mddocuments the behaviour next to the CI read retries.Evidence
git ls-remote --heads origin refs/heads/issue-880 refs/heads/issue-880-branch-* failed: error: RPC failed; curl 16 Error in the HTTP2 framing layer(from the issue). Before the review fix, a missing ref over protocol v0 was retried:cargo test --bin thirdshift missing_refFAILED withleft: 3, right: 1.After: new tests, each against a real local origin whose
uploadpack/receivepackfails on cue:Full suite
cargo test --no-fail-fast: 2151 passed, 0 failed. An earlier full run had one failure intests/console/stop.rs(console_stop_confirms_authenticates_and_triages_or_requeues_a_live_command). That test passes when run alone and in the full rerun, and it doesn't touch git.Merge Danger
Door: two-way
Only the retry policy around existing commands changes. Reverting it brings back fail-on-first-attempt.
Blast Radius: small
At worst, a misclassified permanent failure costs 3s and two extra progress lines before it fails with the same cause. Pushes and other mutations are never retried.
Review
Both reports are under
.thirdshift-review-gNunIZ/(not committed). Addressed:Interruption::pause;reads_originwas renamedreads_remote; theDROPPED_STREAMliteral is reused; the integration test's upload-pack is installed by a childinstall, so a parallel test cannot hit "Text file busy".Changed files the review left unread:
src/process.rswas not read by the Spec reviewer. The review-fix commit'sInterruption::pausechange tosrc/process.rsandsrc/github.rswas made after both reviews and was not re-reviewed by either axis. The reviewers read every other changed file.Unaddressed findings
Standards
GitHub::retry_read(src/github.rs:899). Partly addressed: the repeated wait is nowInterruption::pause. The loops stay separate because they decide on different things.retry_readclassifies ananyhow::ErrorcarryingReadFailure. The git loop classifies a completedOutput's stderr, and only after the lock-wait loop inside it (src/git.rs,retried_output_checked). A generic helper would have to take both shapes and three closures, and that would make a shallower interface, not a deeper one.transport::is_transientis shaped likecheck_read::is_transient. Declined. The status grammars differ: gh writesHTTP 503and is matched withsplit("HTTP ")atsrc/github/check_read.rs:46, while git/curl writereturned error: 503/RPC failed; HTTP 503(src/git/transport.rs,http_status). The phrase lists overlap in only one entry. The issue's Key interfaces ask for a classifier "analogous tocheck_read::is_transient, matching on git's stderr", and a separate module is that.origin_fails(pack: &str). Declined: it is test-only, and both call values are literals in the same file (src/git.rs, mod tests). A wrong value fails the test's own connection count.tests/run_notification.rs. Declined. The acceptance criterion requires that "the Pass continues with no failure notification", and that file holds the Resend stand-in and thethe_one_request/texthelpers the test uses to assert the notification'sResult: ready for review.Spec
GLOSSARY.md:69sets that completion work "finishes after Command interruption without clearing it; ordinary synchronization remains interruptible", andGit::completiondocuments that it ignores recorded interruption (src/git.rs:35). The issue's criterion "Interrupting the Command during a retry wait ends the wait promptly" holds for ordinary Commands; seeinterruption_ends_the_wait_before_a_read_of_origin_is_run_again.Security
src/git.rs(reads_remote,retried_output_checked),src/git/transport.rsandInterruption::pause. Onlyls-remoteandfetchare retried; an argument shape that isn't recognized falls back to a single attempt.pushis never retried. The retry progress line repeats the git error the failure cause already showed, and the delays are bounded.Closes #880
🤖 Generated with Claude Code
Built with claude · claude-opus-5-5 · medium
Security review outcome
No unaddressed introduced findings.