Skip to content

Auto-port 4.1: Http2: Reserve promised stream before running the request verifier - #17563

Merged
normanmaurer merged 1 commit into
4.1from
auto-port-pr-17495-to-4.1
Sep 21, 2026
Merged

normanmaurer merged 1 commit into
4.1from
auto-port-pr-17495-to-4.1

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

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:

  • 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.

…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-app

testlens-app Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🚨 TestLens detected 1 failed test 🚨

Here is what you can do:

  1. Inspect the test failures carefully.
  2. If you are convinced that some of the tests are flaky, you can mute them below.
  3. Finally, trigger a rerun by checking the rerun checkbox.

Test Summary

Build PR / linux-x86_64-java21-graal build > Netty/Resolver/DNS

Test Runs Flakiness
DnsAddressResolverGroupTest > testSharedDNSCacheAcrossEventLoops() ❌ 1% 🟡

🏷️ Commit: cab5b49
▶️ Tests: 339286 executed
🟡 Checks: 13/17 completed

Test Failures

DnsAddressResolverGroupTest > testSharedDNSCacheAcrossEventLoops() (Netty/Resolver/DNS in Build PR / linux-x86_64-java21-graal build)
org.opentest4j.AssertionFailedError: expected: <netty.io/172.67.130.186> but was: <netty.io/104.21.3.132>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertSame.failNotSame(AssertSame.java:50)
	at org.junit.jupiter.api.AssertSame.assertSame(AssertSame.java:35)
	at org.junit.jupiter.api.AssertSame.assertSame(AssertSame.java:30)
	at org.junit.jupiter.api.Assertions.assertSame(Assertions.java:2860)
	at io.netty.resolver.dns.DnsAddressResolverGroupTest.testSharedDNSCacheAcrossEventLoops(DnsAddressResolverGroupTest.java:92)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
expected actual
netty.io/172.67.130.186 netty.io/104.21.3.132

Rerun Controls

Note

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.

@normanmaurer
normanmaurer merged commit 71beed1 into 4.1 Sep 21, 2026
13 of 18 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-17495-to-4.1 branch September 21, 2026 09:14
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]>
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