Skip to content

Auto-port 5.0: Http2ConnectionHandler: report at most one stream error for a CompositeStreamException - #17596

Merged
normanmaurer merged 2 commits into
5.0from
auto-port-pr-17470-to-5.0
Sep 22, 2026
Merged

normanmaurer merged 2 commits into
5.0from
auto-port-pr-17470-to-5.0

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #17470 to 5.0
Cherry-picked commit: 9676719


Motivation:

RFC 9113, Section 5.4 states that implementations SHOULD report at
most one stream and one connection error as a result of processing a
single condition, even if multiple errors are discovered. When
DefaultHttp2LocalFlowController accumulates per-stream failures (e.g.
while applying a new SETTINGS initial window size) into a single
CompositeStreamException, Http2ConnectionHandler.onError iterated all
contained StreamExceptions and wrote an RST_STREAM for each one,
exceeding the recommended limit of one stream error per result.

Modifications:

  • Http2ConnectionHandler.onError only reports the first StreamException
    contained in a CompositeStreamException instead of iterating and
    reporting every one of them.
  • Add unit tests

Result:

Only one RST_STREAM is written per CompositeStreamException, in line
with the RFC 9113 recommendation.

…teStreamException (#17470)

Motivation:

RFC 9113, Section 5.4 states that implementations SHOULD report at
most one stream and one connection error as a result of processing a
single condition, even if multiple errors are discovered. When
DefaultHttp2LocalFlowController accumulates per-stream failures (e.g.
while applying a new SETTINGS initial window size) into a single
CompositeStreamException, Http2ConnectionHandler.onError iterated all
contained StreamExceptions and wrote an RST_STREAM for each one,
exceeding the recommended limit of one stream error per result.

Modifications:

- Http2ConnectionHandler.onError only reports the first StreamException
  contained in a CompositeStreamException for a specific stream instead of iterating and
  reporting every one of them.
- Add unit tests

Result:

Only one RST_STREAM is written per CompositeStreamException, in line
with the RFC 9113 recommendation.

(cherry picked from commit 9676719)
@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Sep 22, 2026
@testlens-app

testlens-app Bot commented Sep 22, 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/Transport

Test Runs Flakiness
NioEventLoopTest > testTaskRemovalOnShutdownThrowsNoUnsupportedOperationExcepti… ❌ 0% 🟢

🏷️ Commit: 33aaca5
▶️ Tests: 205211 executed
⚪️ Checks: 12/12 completed

Test Failures

NioEventLoopTest > testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException() (Netty/Transport in Build PR / windows-x86_64-java25-boringssl)
org.opentest4j.AssertionFailedError: Unexpected type, expected: <java.util.concurrent.RejectedExecutionException> but was: <java.lang.OutOfMemoryError>
	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.AssertInstanceOf.assertInstanceOf(AssertInstanceOf.java:49)
	at org.junit.jupiter.api.AssertInstanceOf.assertInstanceOf(AssertInstanceOf.java:31)
	at org.junit.jupiter.api.Assertions.assertInstanceOf(Assertions.java:3614)
	at io.netty.channel.nio.NioEventLoopTest.testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException(NioEventLoopTest.java:178)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
expected actual
class java.util.concurrent.RejectedExecutionException class java.lang.OutOfMemoryError

Rerun Controls

Select tests to mute in this pull request:

  • NioEventLoopTest > testTaskRemovalOnShutdownThrowsNoUnsupportedOperationException()

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 9656c24 into 5.0 Sep 22, 2026
12 of 13 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-17470-to-5.0 branch September 22, 2026 21:53
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