Skip to content

fix: handle http2 goaway race conditions#1

Merged
bayoumi17m merged 1 commit into
fix/http2-race-conditionfrom
claude/add-httpcore-tests-wvpzn
Jan 29, 2026
Merged

fix: handle http2 goaway race conditions#1
bayoumi17m merged 1 commit into
fix/http2-race-conditionfrom
claude/add-httpcore-tests-wvpzn

Conversation

@bayoumi17m

Copy link
Copy Markdown
Owner

No description provided.

Add tests/_async/test_http2_goaway.py with 41 tests covering:
- ConnectionGoingAway exception properties (is_safe_to_retry,
  is_graceful_shutdown, may_have_side_effects)
- HTTP/2 connection GOAWAY handling and DRAINING state
- Request phase tracking (headers_sent, body_sent)
- Pool-level retry logic based on GOAWAY context

Fix critical bug: reorder exception handlers so ConnectionGoingAway
is caught before ConnectionNotAvailable (its parent class). The
original order caused all GOAWAY exceptions to be caught by the
wrong handler and retried unconditionally.

Coverage achieved:
- httpcore/_exceptions.py: 100%
- httpcore/_async/connection_pool.py: 100%
- httpcore/_async/http2.py: 97%

https://claude.ai/code/session_01PbGidFEEpj8txq8Qt7refq
@bayoumi17m bayoumi17m changed the base branch from master to fix/http2-race-condition January 29, 2026 19:41
@bayoumi17m bayoumi17m merged commit 6d0511a into fix/http2-race-condition Jan 29, 2026
@bayoumi17m bayoumi17m deleted the claude/add-httpcore-tests-wvpzn branch January 29, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants