Skip to content

fix(github): bound the GitHub session read at 60 seconds - #4636

Merged
dan-petty merged 2 commits into
mainfrom
fix/4626-github-session-read-timeout
Nov 11, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4626-github-session-read-timeout

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The GitHub session read with the read timeout of the HTTP entry point, 3,600 s. That is as long as the calls around a GitHub read, such as the watch of the checks of the implement job, so their own deadline stopped them before the read failed. GitHub ends a REST request after 10 s, so a read that waits longer gets no answer.

The session's client now waits at most DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS (60 s) for each read. A read with no answer fails with GitHubUnreadError naming ReadTimeout and is not sent again. The other clients of the entry point, the release downloads of devops install-tools included, keep DEFAULT_HTTP_TIMEOUT_SECONDS. A test holds the chain of bounds around a GitHub read: Valkey command 2 s < session read 60 s < watch of the checks 3,600 s. ADR 0006 states the new bound.

Closes #4626

Change: openspec/changes/archive/2026-11-11-4626-bound-the-github-session-read-at/

The GitHub session read with the entry point's read timeout of 3,600 s.
That is as long as the calls around a GitHub read, such as the watch of
the checks of the implement job, so their own deadline stopped them
before the read failed. GitHub ends a REST request after 10 s.

The session's client now reads within DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS
(60 s). Downloads keep DEFAULT_HTTP_TIMEOUT_SECONDS. A test holds the chain
of bounds around a GitHub read.
@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 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Evidence

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main, base 818ac6f):

  failed on base: tests.github.test_github_session::test_the_sessions_client_waits_a_public_connect_timeout_and_a_read_timeout_of_60_seconds (assert (10.0, 3600.0, None) == (10.0, None, 60.0))
  failed on base: tests.github.test_github_session_timeouts::test_each_bound_of_the_chain_is_shorter_than_the_bound_around_it[DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS-DEFAULT_ROADMAP_IMPLEMENT_MONITOR_TIMEOUT_SECONDS] (AssertionError: assert inf < 3600)
  failed on base: tests.github.test_github_session_timeouts::test_a_host_that_does_not_answer_fails_the_read_at_the_sessions_read_bound (AttributeError: ... has no attribute 'DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS')
3 failed on base (3 failed and 118 passed in tests/commands/test_install_tools.py, tests/github/test_github_session.py, tests/github/test_github_session_timeouts.py; 0 errored).

Mutation check of the chain test. With DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS = 3600.0 (the old read bound, equal to the watch of the checks), the chain test fails for the pair DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS-DEFAULT_ROADMAP_IMPLEMENT_MONITOR_TIMEOUT_SECONDS (1 failed, 1 passed). At 60.0 both pairs pass.

Silent host. The test binds a loopback listener that accepts no connection. httpx2's own AsyncHTTPTransport sends the request over plain HTTP behind the transport hook, so the kernel completes the connect and only the read bound ends the wait. With a bound of 0.05 s the session raises GitHubUnreadError naming ReadTimeout after one request, with no resend wait. The test does not measure the time.

Local runs.

  • uv run devops ci test tests/github tests/http tests/config tests/invariants: 2441 passed.
  • uv run devops ci docs: all documentation files are up to date.
  • uv run devops openspec check: passed.

Premise. GitHub, "Troubleshooting the REST API" (API version 2026-03-10), read on 2026-11-11: "If GitHub takes more than 10 seconds to process an API request, GitHub will terminate the request". HTTPX "Timeouts": the read timeout is the longest wait "for a chunk of data to be received", so a slow large answer is not cut while it arrives.

Notes

  • Live steps: none. The change has no setting, ConfigMap or manifest. The roadmap Service and the runner Jobs get the bound with the next release image.
  • The write bound of the session stays at DEFAULT_HTTP_TIMEOUT_SECONDS: the item names the read, and request_timeout sets the write bound for every client of the entry point.
  • The reference step (120 s) and the alternatives unit deadline of feat(roadmap): run each alternatives check in its own pod #4573 (3,600 s) are not in the code yet. Each one joins _CHAIN in tests/github/test_github_session_timeouts.py in the item that adds it.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 16:26
@dan-petty
dan-petty enabled auto-merge (squash) November 11, 2026 16:26
@dan-petty
dan-petty merged commit a87442a into main Nov 11, 2026
32 checks passed
@dan-petty
dan-petty deleted the fix/4626-github-session-read-timeout branch November 11, 2026 16:44
dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.112.2](v0.112.1...v0.112.2)
(2026-11-11)


### Bug Fixes

* **github:** bound the GitHub session read at 60 seconds
([#4636](#4636))
([a87442a](a87442a))
* **roadmap:** bound the shadow mark probability to 0 to 1
([#4655](#4655))
([abf1166](abf1166))
* **roadmap:** halt implement step on consecutive refusals
([#4659](#4659))
([9bcf0f5](9bcf0f5))
* **security:** file an issue for each Trivy-config alert group
([#4640](#4640))
([a7668fe](a7668fe))
* **service:** route issues webhooks past scoped intake
([#4631](#4631))
([caf4c7e](caf4c7e))

---
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): bound the GitHub session read at 60 seconds

1 participant