Skip to content

fix(github): send a GET again when its connection is lost - #3608

Merged
dan-petty merged 10 commits into
mainfrom
fix/3506-retry-get-on-lost-connection
Nov 5, 2026
Merged

dan-petty merged 10 commits into
mainfrom
fix/3506-retry-get-on-lost-connection

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

A GitHub GET request fails immediately when its connection is lost. GitHub gives no answer. One lost connection can therefore fail a CI job, or a round of a Service row.

This change sends a lost GET again, up to DEFAULT_GH_MAX_RETRIES times. Each resend waits on the rate limit ledger of the identity first. A lost write is not sent again, because GitHub may already have applied it. A refused connect and a timeout are not retried.

Closes #3506

Change: openspec/changes/archive/2026-11-05-3506-retry-get-on-lost-connection/

The change folder plans a retry of a GitHub GET whose connection is lost. A write is not sent again. The session retries the same URL, so a listing resends only its failed page.
Five tests of the GitHub session: a GET that loses its connection is sent again, a GET that loses it on every attempt raises after three sends, a write is sent once, a listing resends page 3 only, and a resend waits through the identity ledger. The write test passes on the base, since a write is never resent; it guards that rule.
A GET whose connection is lost before GitHub's answer is read is sent again, up to DEFAULT_GH_MAX_RETRIES times. Each resend paces on the identity's ledger and waits from the read floor, as a read 5xx waits. A write and a refused connect are not sent again.
The session's retry paragraph of ADR 0006 names the lost connections that a GET is sent again after, the write it never sends again, and the budget of one GET.
Rewrite the docstrings, the comment and the ADR Retries paragraph that
state the resend of a GET whose connection is lost. The rule and the
budget do not change.
Split the docstrings of the lost-connection tests. The assertions do not
change.
Give each task group its kind. State that the resend budget applies to
each gidgethub attempt. Correct the size of the change, the test count,
and the overlap with the local branch of #3497.
The four changed tests fail on origin/main and pass on this branch.
The gate fails only on the known host failures of #3585.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/github GitHub Projects v2, Views, Milestones, Labels, and PR automation labels Nov 5, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Finish notes for #3506

Local checks

  • uv run devops ci ran on the branch before the last two docs commits (tick of the full gate, archive). All gates passed except pytest & coverage. The coverage gate did not pass because pytest failed.
  • Pytest gave 4 failed, 18639 passed, 2 skipped and 1 error.
  • All four failures and the one error are the known host failures of fix(ci): host state fails four tests and one case #3585:
    • tests/crypto/test_ssh.py::test_get_ssh_key_prefix_resolution
    • tests/telemetry/test_config_env_overrides.py::test_find_project_config_path_skips_directory
    • tests/commands/test_devcontainer_install_tools_dry_run.py::test_mark_only_commands_under_global_dry_run
    • tests/ai/test_tool_executor_contract.py::test_the_direct_executor_refuses_a_network_profile_before_it_starts_the_tool[direct] (failed, and its teardown errored)
  • The pytest step took 6m 54s. devops ci warned that it is over the 5 minute budget. fix(ci): the pytest step of devops ci exceeds the 5-minute budget #3593 covers this warning. A measurement was added there.
  • The branch already started at origin/main (d254410). The rebase changed nothing, so no test was run again for it.

Fail-to-pass

  • uv run devops ci fail-to-pass --base origin/main exited 0.
  • Four tests fail on the base. Each one is added by this change:
    • test_a_get_that_loses_its_connection_is_sent_again
    • test_a_get_that_loses_its_connection_on_every_attempt_raises_after_the_retries
    • test_a_listing_that_loses_page_3_sends_page_3_again
    • test_a_lost_get_waits_through_the_identity_ledger
  • No failure carries the message of the host path guard.

Deviations

  • None. The code follows the issue and the proposal. The acceptance table of the archived change maps each criterion to its test.

Open items

  • A person must confirm the Service output that the issue names (StreamReset, ConnectionTerminated). origin/main prints only RemoteProtocolError. This does not change the fix.
  • The local branch fix/3497-cut-unchanged-github-reads is not on origin. It edits src/devops_cli/github/session_transport.py and src/devops_cli/github/rate_limiter.py. A merge of that branch can conflict with this change.
  • The stage recommendation is draft. The pull request stays a draft until a person decides to mark it ready.

@dan-petty
dan-petty marked this pull request as ready for review November 5, 2026 12:09
@dan-petty
dan-petty merged commit 4528f49 into main Nov 5, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/3506-retry-get-on-lost-connection branch November 5, 2026 12:09
dan-petty pushed a commit that referenced this pull request Nov 5, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.61.0](v0.60.0...v0.61.0)
(2026-11-05)


### Features

* **roadmap:** check each behavior group fails on base before the change
([#3602](#3602))
([7b8a4a1](7b8a4a1))
* **roadmap:** the inbox lists every person wait of each service repo
([#3616](#3616))
([b81913b](b81913b))
* **telemetry:** measure how long roadmap items wait in each state
([#3601](#3601))
([05c9ebd](05c9ebd))


### Bug Fixes

* **github:** send a GET again when its connection is lost
([#3608](#3608))
([4528f49](4528f49))
* **roadmap:** accept a clean merge by a person on a branch
([#3603](#3603))
([4fff490](4fff490))
* **roadmap:** the stage job waits for an open plan that creates a path
([#3613](#3613))
([7e66373](7e66373))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/github GitHub Projects v2, Views, Milestones, Labels, and PR automation type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(github): the session retries a read that loses its connection

1 participant