Skip to content

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

Closed

Description

@dan-petty

Problem

A GitHub GET that loses its connection fails at once, with no retry. One lost connection then turns a CI job red or loses a Service round. A failed round counts toward the suspension of the row (FailureLedger.failed, src/devops_cli/roadmap/run.py).

Evidence in CI, after the end of the evaluation window at 2026-11-04T15:05Z: run 41858126247, job 126672205735, a push to main that started at 2026-11-04T15:28:35Z. The job Test Job Duration (.github/workflows/ci.yml:187) printed:

GitHub gave no readable answer to GET /repos/dan-petty/devops-cli/actions/runs/41772844168/jobs?per_page=100: RemoteProtocolError

In the last 40 completed pushes to main, 21 runs failed and 19 were cancelled. Test Job Duration failed in all 21: 20 on the bound (444 s to 490 s against 300 s), and 1 on this read. #3050 owns the bound. No open issue owns the read.

Evidence in the Service, in the window 2026-11-03T15:05Z to 2026-11-04T15:05Z. 3 rounds failed on the same error:

  • intake at 2026-11-03T19:23:07Z: issues listing, page 16, StreamReset.
  • intake at 2026-11-04T11:53:02Z: issues listing, page 30, ConnectionTerminated.
  • refine at 2026-11-04T11:53:02Z: issues/2232/comments, page 1, ConnectionTerminated.

The cause is in src/devops_cli/github/session_transport.py. _UNREAD (line 101) holds httpx2.HTTPError, and _exchange (lines 344-345) raises classify_http_error for it with no retry. handle_rate_limit_error (line 269) takes only HTTPException, so it retries a rate limit and a read 5xx, and nothing else. src/devops_cli/ci/job_time.py is not the place of the defect, and its printed text already names the read and not the bound.

Expected

A GET that loses its connection is sent again, up to DEFAULT_GH_MAX_RETRIES (2) retries, with a wait from the same ledger path as a read 5xx. A listing sends the failed page again. A write is not sent again, because GitHub may have applied it. A refused connect stays as the module states: no retry. The plan can change that rule only with a stated reason. The plan names the httpx2 error classes that the retry takes.

Acceptance criteria

  • A test: RemoteProtocolError on the first GET and an answer on the second gives the normal result.
  • A test: RemoteProtocolError on each attempt ends after DEFAULT_GH_MAX_RETRIES retries, and the error stays GitHubUnreadError with its present text.
  • A test: a POST that loses its connection sends one request.
  • A test: a listing that loses its connection on page 3 sends page 3 again and not page 1, and it returns each item once.
  • A test: httpx2.ConnectError on a GET sends one request. If the plan changes this rule, the test and the module docstring hold the new rule.
  • A test: a retry waits through the ledger of the identity.

Existing tool considered

  • gidgethub calls handle_rate_limit_error for an HTTPException only, so it does not cover a transport error.
  • httpx2.HTTPTransport(retries=...) gives connection retries, according to its docstring. It does not cover an answer that stops after the connect.
  • retry_wait and DEFAULT_GH_MAX_RETRIES in the transport, and retry_delay in src/devops_cli/github/rate_limiter.py, which uses tenacity. The change extends this project code to a transport error on a GET. It adds no library.

Related

Related: #3050

Activity

  1. added
    source/agent
    type/bug
    scope/github
    status/new
    value/medium
    effort/medium
    on Nov 4, 2026
  2. dan-petty commented on Nov 4, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/github. The (github) scope of the title gives the scope.
    • Priority: P2-Medium. Intermittent transport failures turn CI jobs red and lose Service rounds, but the frequency is low and one other issue owns most CI failures. The failed run 41858126247 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.
    • Value: Medium. Each occurrence loses a Service round or a CI job, but the event is rare and the project continues to function.
    • Effort: Medium. The change touches one module, adds retry for named httpx2 error classes on GET only, and requires six focused tests.
    • Related: refactor(github): the github session owns transport, ledger, error classes and link pagination #983, which asks for a different change. #983 is the umbrella refactor that created the session transport architecture; this candidate fixes a defect in the result it delivered.
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 4, 2026
  4. removed
    status/in-progress
    owner/agent
    on Nov 5, 2026
  5. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-05 12:32 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/githubsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions