Repository navigation
Auto-port 4.1: Http2: Reserve promised stream before running the request verifier - #17563
Merged
Merged
Conversation
…17495) Motivation: In DefaultHttp2ConnectionDecoder.onPushPromiseRead(), the promised stream was only reserved via reservePushStream() after the Http2PromisedRequestVerifier checks (isAuthoritative/isCacheable/ isSafe) passed. If the verifier rejected the promised request, the method threw before the stream was ever reserved, so the connection lost all bookkeeping of that stream ID's existence. Modification: - Move the reservePushStream() call ahead of the verifier checks in onPushPromiseRead(), so the promised stream is reserved as soon as the parent stream state is validated, and any subsequent verifier rejection fails an already-reserved stream instead of leaving no record of it. - Add a unit test that rejects a push promise via a custom verifier and asserts the stream was still reserved. Result: The promised stream ID's existence is always tracked once a PUSH_PROMISE is otherwise valid enough to reach verification. (cherry picked from commit 8488ebd)
🚨 TestLens detected 1 failed test 🚨Here is what you can do:
Test SummaryBuild PR / linux-x86_64-java21-graal build > Netty/Resolver/DNS
🏷️ Commit: cab5b49 Test FailuresDnsAddressResolverGroupTest > testSharedDNSCacheAcrossEventLoops() (Netty/Resolver/DNS in Build PR / linux-x86_64-java21-graal build)
Rerun ControlsNote Checks are currently running using the configuration below. Select tests to mute in this pull request: 🔲 DnsAddressResolverGroupTest > testSharedDNSCacheAcrossEventLoops() Reuse successful test results: 🔲 ♻️ Only rerun the tests that failed or were muted before Click the checkbox to trigger a rerun: 🔲 Rerun jobs Learn more about TestLens at testlens.app/docs. |
lltopk
pushed a commit
to lltopk/netty
that referenced
this pull request
Oct 24, 2026
…est verifier (netty#17563) Auto-port of netty#17495 to 4.1 Cherry-picked commit: 8488ebd --- Motivation: In DefaultHttp2ConnectionDecoder.onPushPromiseRead(), the promised stream was only reserved via reservePushStream() after the Http2PromisedRequestVerifier checks (isAuthoritative/isCacheable/ isSafe) passed. If the verifier rejected the promised request, the method threw before the stream was ever reserved, so the connection lost all bookkeeping of that stream ID's existence. Modification: - Move the reservePushStream() call ahead of the verifier checks in onPushPromiseRead(), so the promised stream is reserved as soon as the parent stream state is validated, and any subsequent verifier rejection fails an already-reserved stream instead of leaving no record of it. - Add a unit test that rejects a push promise via a custom verifier and asserts the stream was still reserved. Result: The promised stream ID's existence is always tracked once a PUSH_PROMISE is otherwise valid enough to reach verification. Co-authored-by: Norman Maurer <[email protected]>
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.
Auto-port of #17495 to 4.1
Cherry-picked commit: 8488ebd
Motivation:
In DefaultHttp2ConnectionDecoder.onPushPromiseRead(), the promised
stream was only reserved via reservePushStream() after the
Http2PromisedRequestVerifier checks (isAuthoritative/isCacheable/
isSafe) passed. If the verifier rejected the promised request, the
method threw before the stream was ever reserved, so the connection
lost all bookkeeping of that stream ID's existence.
Modification:
onPushPromiseRead(), so the promised stream is reserved as soon as
the parent stream state is validated, and any subsequent verifier
rejection fails an already-reserved stream instead of leaving no
record of it.
and asserts the stream was still reserved.
Result:
The promised stream ID's existence is always tracked once a
PUSH_PROMISE is otherwise valid enough to reach verification.