GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use LocalIoHandler instead of DefaultEventLoop for LocalChannel tests in codec-http2 by normanmaurer · Pull Request #17697 · netty/netty

Conversation

@normanmaurer

@normanmaurer normanmaurer commented Oct 1, 2026

Copy link
Copy Markdown
Member

Motivation:

Http2MultiplexTransportTest failed on CI in the LeakPresenceExtension
afterAll check ("Possible memory leak detected for resource scope")
although every test in the class passed. The check waits up to 5 seconds
for resources to be released, so something stayed open for good rather
than just shutting down slowly.

Several tests run LocalChannel / LocalServerChannel on a DefaultEventLoop
and then call shutdownGracefully() without waiting. Unlike
LocalIoHandler (and NioIoHandler for the other tests in the class),
DefaultEventLoop does not close the channels registered with it when it
shuts down. A server-side child channel is therefore only closed if the
peer-close task still runs before the loop terminates. If it does not,
the channel and whatever it still holds (for example the large wrapped
payloads written by the auto-read tests added in #17617) is never
released, which the leak presence detector reports.

Modification:

  • Use new MultiThreadIoEventLoopGroup(1, LocalIoHandler.newFactory())
    instead of new DefaultEventLoop() in the LocalChannel based tests of
    Http2MultiplexTransportTest, Http2MultiplexCodecBuilderTest and
    Http2StreamChannelBootstrapTest. LocalIoHandler closes all registered
    channels when the group shuts down. A single thread is kept so server
    and client still share one event loop as before.

Result:

Channels of the LocalChannel tests are always closed when their event
loop group shuts down, which removes one possible source of the flaky
leak report.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@normanmaurer
Use LocalIoHandler instead of DefaultEventLoop for LocalChannel tests…
cb6eb7f
… in codec-http2

Motivation:

Http2MultiplexTransportTest failed on CI in the LeakPresenceExtension
afterAll check ("Possible memory leak detected for resource scope")
although every test in the class passed. The check waits up to 5 seconds
for resources to be released, so something stayed open for good rather
than just shutting down slowly.

Several tests run LocalChannel / LocalServerChannel on a DefaultEventLoop
and then call shutdownGracefully() without waiting. Unlike
LocalIoHandler (and NioIoHandler for the other tests in the class),
DefaultEventLoop does not close the channels registered with it when it
shuts down. A server-side child channel is therefore only closed if the
peer-close task still runs before the loop terminates. If it does not,
the channel and whatever it still holds (for example the large wrapped
payloads written by the auto-read tests added in #17617) is never
released, which the leak presence detector reports.

Modification:

- Use `new MultiThreadIoEventLoopGroup(1, LocalIoHandler.newFactory())`
instead of `new DefaultEventLoop()` in the LocalChannel based tests of
Http2MultiplexTransportTest, Http2MultiplexCodecBuilderTest and
Http2StreamChannelBootstrapTest. LocalIoHandler closes all registered
channels when the group shuts down. A single thread is kept so server
and client still share one event loop as before.

Result:

Channels of the LocalChannel tests are always closed when their event
loop group shuts down, which removes one possible source of the flaky
leak report.
@normanmaurer normanmaurer added this to the 4.2.19.Final milestone Oct 1, 2026
@normanmaurer normanmaurer added needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Oct 1, 2026
@testlens-app

testlens-app Bot commented Oct 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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 / macos-x86_64-java11-boringssl build > Netty/Transport/Native/KQueue

Test Runs Flakiness
KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeMixedByteBuf(TestInfo) ❌ 4% 🟡

🏷️ Commit: cb6eb7f
▶️ Tests: 425158 executed
⚪️ Checks: 30/30 completed

Test Failures

KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeMixedByteBuf(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-x86_64-java11-boringssl build)
org.opentest4j.AssertionFailedError
	at io.netty.testsuite.transport.socket.DatagramUnicastTest.testSimpleSend0(DatagramUnicastTest.java:368)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest.testSimpleSend(DatagramUnicastTest.java:194)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest.testSimpleSendCompositeMixedByteBuf(DatagramUnicastTest.java:172)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest$5.run(DatagramUnicastTest.java:158)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest$5.run(DatagramUnicastTest.java:155)
	at io.netty.testsuite.transport.AbstractComboTestsuiteTest.run(AbstractComboTestsuiteTest.java:52)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest.testSimpleSendCompositeMixedByteBuf(DatagramUnicastTest.java:155)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)

Rerun Controls

Select tests to mute in this pull request:

  • KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeMixedByteBuf(TestInfo)

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer merged commit d3817ad into 4.2 Oct 1, 2026
30 of 31 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer deleted the local_eventloop branch October 1, 2026 13:59
@netty-project-bot netty-project-bot mentioned this pull request Oct 1, 2026
Auto-port 4.1: Use LocalIoHandler instead of DefaultEventLoop for LocalChannel tests in codec-http2 #17708
Merged
@netty-project-bot

netty-project-bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Auto-port PR for 4.1: #17708

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. label Oct 1, 2026
@netty-project-bot

netty-project-bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Could not create auto-port PR.
Got conflicts when cherry-picking onto 5.0.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Port for 5.0 #17709

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer added a commit that referenced this pull request Oct 1, 2026
@netty-project-bot @normanmaurer
Auto-port 4.1: Use LocalIoHandler instead of DefaultEventLoop for Loc…
55e8a6a
…alChannel tests in codec-http2 (#17708)

Auto-port of #17697 to 4.1
Cherry-picked commit: d3817ad

---
Motivation:

Http2MultiplexTransportTest failed on CI in the LeakPresenceExtension
afterAll check ("Possible memory leak detected for resource scope")
although every test in the class passed. The check waits up to 5 seconds
for resources to be released, so something stayed open for good rather
than just shutting down slowly.

Several tests run LocalChannel / LocalServerChannel on a
DefaultEventLoop
and then call shutdownGracefully() without waiting. Unlike
LocalIoHandler (and NioIoHandler for the other tests in the class),
DefaultEventLoop does not close the channels registered with it when it
shuts down. A server-side child channel is therefore only closed if the
peer-close task still runs before the loop terminates. If it does not,
the channel and whatever it still holds (for example the large wrapped
payloads written by the auto-read tests added in #17617) is never
released, which the leak presence detector reports.

Modification:

- Use `new MultiThreadIoEventLoopGroup(1, LocalIoHandler.newFactory())`
instead of `new DefaultEventLoop()` in the LocalChannel based tests of
Http2MultiplexTransportTest, Http2MultiplexCodecBuilderTest and
Http2StreamChannelBootstrapTest. LocalIoHandler closes all registered
channels when the group shuts down. A single thread is kept so server
and client still share one event loop as before.

Result:

Channels of the LocalChannel tests are always closed when their event
loop group shuts down, which removes one possible source of the flaky
leak report.

Co-authored-by: Norman Maurer <[email protected]>
normanmaurer added a commit that referenced this pull request Oct 1, 2026
@normanmaurer
Port: Use LocalIoHandler instead of DefaultEventLoop for LocalChannel…
add0311
… tests in codec-http2 (#17697) (#17709)

Motivation:

Http2MultiplexTransportTest failed on CI in the LeakPresenceExtension
afterAll check ("Possible memory leak detected for resource scope")
although every test in the class passed. The check waits up to 5 seconds
for resources to be released, so something stayed open for good rather
than just shutting down slowly.

Several tests run LocalChannel / LocalServerChannel on a
DefaultEventLoop
and then call shutdownGracefully() without waiting. Unlike
LocalIoHandler (and NioIoHandler for the other tests in the class),
DefaultEventLoop does not close the channels registered with it when it
shuts down. A server-side child channel is therefore only closed if the
peer-close task still runs before the loop terminates. If it does not,
the channel and whatever it still holds (for example the large wrapped
payloads written by the auto-read tests added in #17617) is never
released, which the leak presence detector reports.

Modification:

- Use `new MultiThreadIoEventLoopGroup(1, LocalIoHandler.newFactory())`
instead of `new DefaultEventLoop()` in the LocalChannel based tests of
Http2MultiplexTransportTest, Http2MultiplexCodecBuilderTest and
Http2StreamChannelBootstrapTest. LocalIoHandler closes all registered
channels when the group shuts down. A single thread is kept so server
and client still share one event loop as before.

Result:

Channels of the LocalChannel tests are always closed when their event
loop group shuts down, which removes one possible source of the flaky
leak report.
@normanmaurer normanmaurer removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Oct 1, 2026
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
@netty-project-bot @normanmaurer @lltopk
Auto-port 4.1: Use LocalIoHandler instead of DefaultEventLoop for Loc…
3d8d152
…alChannel tests in codec-http2 (netty#17708)

Auto-port of netty#17697 to 4.1
Cherry-picked commit: d3817ad

---
Motivation:

Http2MultiplexTransportTest failed on CI in the LeakPresenceExtension
afterAll check ("Possible memory leak detected for resource scope")
although every test in the class passed. The check waits up to 5 seconds
for resources to be released, so something stayed open for good rather
than just shutting down slowly.

Several tests run LocalChannel / LocalServerChannel on a
DefaultEventLoop
and then call shutdownGracefully() without waiting. Unlike
LocalIoHandler (and NioIoHandler for the other tests in the class),
DefaultEventLoop does not close the channels registered with it when it
shuts down. A server-side child channel is therefore only closed if the
peer-close task still runs before the loop terminates. If it does not,
the channel and whatever it still holds (for example the large wrapped
payloads written by the auto-read tests added in netty#17617) is never
released, which the leak presence detector reports.

Modification:

- Use `new MultiThreadIoEventLoopGroup(1, LocalIoHandler.newFactory())`
instead of `new DefaultEventLoop()` in the LocalChannel based tests of
Http2MultiplexTransportTest, Http2MultiplexCodecBuilderTest and
Http2StreamChannelBootstrapTest. LocalIoHandler closes all registered
channels when the group shuts down. A single thread is kept so server
and client still share one event loop as before.

Result:

Channels of the LocalChannel tests are always closed when their event
loop group shuts down, which removes one possible source of the flaky
leak report.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.2.19.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@normanmaurer @netty-project-bot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.