Repository navigation
Keep HTTP/2 uploads multiplexed while serializing shared h2 state - #2
Merged
Merged
Conversation
(cherry picked from commit 7d48dcc)
Place the stream ID in the caller before awaiting socket writes, so cancellation releases active-stream capacity and removes allocated events. Clean up before-allocation errors, and preserve Python 3.8-compatible development requirements. Add deterministic concurrent stream-ID and cancellation regressions.
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.
A shared HTTP/2 connection now serializes all in-memory h2 state changes without holding a lock over slow uploads, preventing duplicate stream IDs and HPACK corruption; this extends Priyankm23's original source commit
7d48dccwith safe cancellation before/after stream allocation and preserves Python >=3.8 developer dependencies. The deterministic 8-thread/400-request stress test is derived from upstream PR #1118, which stalls or fails in the in-flight upload scenario.Current working source is
43c8d1a; 230 tests passed (6 pre-existing XPASS), 10/10 forced-race stress repetitions, unasync mirror/lint/type checks pass, and a built wheel passes 400 simultaneous HTTP/2 requests and a loopback server that allows GET during an ongoing POST upload. No upstream contribution was opened: both GitHub PAT and connector returned 403, and encode#1118 already exists.Next fault: outbound flow-control credit can fall below zero on large bodies (encode#1082), which still needs a failing concurrent-window reproduction before any change. This PR merges into the maintained fork only; AI-assisted integration and tests were performed by GPT-6, with the original author's commit retained.