Skip to content

Auto-port 5.0: Http2: Reserve promised stream before running the request verifier - #17562

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

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

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #17495 to 5.0
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 / windows-x86_64-java25-boringssl > Netty/Handler

Test Runs Flakiness
OpenSslJdkSslEngineInteroptTest > mustNotCallResumeWhenClientAuthIsOptionalAndNoClientCertIsPr… > [22] OpenSslEngineTestParam{type=Heap, protocolCipherCombo=ProtocolCipherCombo{protocol='TLSv1.2', cipher='TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'}, delegate=true, useTasks=false, useTickets=false} ❌ 0% 🟢

🏷️ Commit: 5a8e8c9
▶️ Tests: 218116 executed
🟡 Checks: 11/12 completed

Test Failures

OpenSslJdkSslEngineInteroptTest > mustNotCallResumeWhenClientAuthIsOptionalAndNoClientCertIsProvided(SSLEngineTestParam) > [22] OpenSslEngineTestParam{type=Heap, protocolCipherCombo=ProtocolCipherCombo{protocol='TLSv1.2', cipher='TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'}, delegate=true, useTasks=false, useTickets=false} (Netty/Handler in Build PR / windows-x86_64-java25-boringssl)
java.util.concurrent.CompletionException: io.netty.handler.ssl.SslHandshakeTimeoutException: handshake timed out after 10000ms
	at io.netty.util.concurrent.DefaultPromise.rethrowIfFailed(DefaultPromise.java:715)
	at io.netty.util.concurrent.DefaultPromise.sync(DefaultPromise.java:396)
	at io.netty.util.concurrent.DefaultPromise.sync(DefaultPromise.java:36)
	at io.netty.handler.ssl.SSLEngineTest.mustNotCallResumeWhenClientAuthIsOptionalAndNoClientCertIsProvided(SSLEngineTest.java:4098)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
	at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: io.netty.handler.ssl.SslHandshakeTimeoutException: handshake timed out after 10000ms
	at io.netty.handler.ssl.SslHandler.lambda$applyHandshakeTimeout$0(SslHandler.java:2207)
	at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:155)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:138)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:131)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:529)
	at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:201)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1159)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	... 1 more

Rerun Controls

Note

Checks are currently running using the configuration below.

Select tests to mute in this pull request:

🔲 OpenSslJdkSslEngineInteroptTest > mustNotCallResumeWhenClientAuthIsOptionalAndNoClientCertIsProvided(SSLEngineTestParam)

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 88b0cc8 into 5.0 Sep 21, 2026
11 of 13 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-17495-to-5.0 branch September 21, 2026 09:13
@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Sep 21, 2026
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