Run HTTP/2 stream openers outside lock#2274
Open
pavel-ptashyts wants to merge 1 commit into
Open
Conversation
Reserve HTTP/2 stream slots and dequeue pending openers while holding pendingLock, then invoke opening callbacks after releasing it. This prevents a slow opener or onRequestSend callback from serializing other request submissions while preserving queue and slot accounting. Add deterministic concurrency tests for immediate and queued openers. Codex on behalf of Pavel Ptashyts Co-Authored-By: Codex <codex@openai.com>
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.
Summary
pendingLockMotivation
Http2ConnectionStateinvoked stream openers while holdingpendingLock. Opening a stream can reachAsyncHandler.onRequestSend, so one slow callback serialized concurrent submissions to the same HTTP/2 connection.The change preserves the Issue #2160 close/enqueue happens-before relationship and atomic stream-slot accounting. Only callback execution moves outside the monitor.
Validation
./mvnw -pl client -Dtest=org.asynchttpclient.netty.channel.Http2ConnectionStateTest test./mvnw -pl client -Dtest='org.asynchttpclient.netty.channel.Http2ConnectionStateTest,org.asynchttpclient.Http2StreamOrphanRegressionTest,org.asynchttpclient.Http2MultiplexBugRegressionTest,org.asynchttpclient.Http2ResidualFixesRegressionTest' testThe local environment only provides JDK 21. The JDK 11
./mvnw clean verifygate was not run locally; the repository CI matrix provides JDK 11 coverage.Attribution
Codex on behalf of Pavel Ptashyts