Repository navigation
Http2MultiplexTransportTest: Fix possible SslContext leak in tests - #17597
Merged
Merged
Conversation
Motivation: testSslException and testFireChannelReadAfterHandshakeSuccess only released the server/client SslContext on the happy path, after latch.await() returned successfully. If an exception was thrown earlier (for example while binding or connecting), the SslContext and the native OpenSSL key material it holds were never released explicitly, and cleanup would only happen once the JVM finalizer ran. This races with the leak presence detector's afterAll check and can be reported as a flaky memory leak in this test class. Modifications: - Release the SslContext instances in a finally block so they are always released, even if an exception is thrown. Result: Fix possible SslContext leak in unit tests.
🚨 TestLens detected 4 failed tests 🚨Here is what you can do:
Failed Jobs without Test Failures❌ Build PR / windows-x86_64-java11-boringssl test reports Test SummaryBuild PR / macos-aarch64-java11-boringssl build > Netty/Transport/Native/KQueue
Build PR / windows-x86_64-java11-boringssl > Netty/Handler
🏷️ Commit: cb096d0 Test FailuresKQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeMixedByteBuf(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-aarch64-java11-boringssl build)KQueueDatagramUnicastIPv6MappedTest > testSimpleSendDirectByteBuf(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-aarch64-java11-boringssl build)KQueueDatagramUnicastIPv6MappedTest > testSimpleSendWithConnect(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-aarch64-java11-boringssl build)OpenSslConscryptSslEngineInteropTest > testSessionInvalidate(SSLEngineTestParam) > [20] OpenSslEngineTestParam{type=Mixed, protocolCipherCombo=ProtocolCipherCombo{protocol='TLSv1.2', cipher='TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'}, delegate=false, useTasks=false, useTickets=true} (Netty/Handler in Build PR / windows-x86_64-java11-boringssl)
Rerun ControlsSelect tests to mute in this pull request:
Reuse successful test results:
Click the checkbox to trigger a rerun:
Learn more about TestLens at testlens.app/docs. |
Contributor
|
Could not create auto-port PR. |
Contributor
|
Could not create auto-port PR. |
Member
Author
|
Port for 5.0: #17598 |
Member
Author
|
Port for 4.1: #17599 |
normanmaurer
added a commit
that referenced
this pull request
Sep 23, 2026
…sts (#17597) (#17599) Motivation: testSslException and testFireChannelReadAfterHandshakeSuccess only released the server/client SslContext on the happy path, after latch.await() returned successfully. If an exception was thrown earlier (for example while binding or connecting), the SslContext and the native OpenSSL key material it holds were never released explicitly, and cleanup would only happen once the JVM finalizer ran. This races with the leak presence detector's afterAll check and can be reported as a flaky memory leak in this test class. Modifications: - Release the SslContext instances in a finally block so they are always released, even if an exception is thrown. Result: Fix possible SslContext leak in unit tests.
normanmaurer
added a commit
that referenced
this pull request
Sep 25, 2026
…sts (#17597) (#17598) Motivation: testSslException and testFireChannelReadAfterHandshakeSuccess only released the server/client SslContext on the happy path, after latch.await() returned successfully. If an exception was thrown earlier (for example while binding or connecting), the SslContext and the native OpenSSL key material it holds were never released explicitly, and cleanup would only happen once the JVM finalizer ran. This races with the leak presence detector's afterAll check and can be reported as a flaky memory leak in this test class. Modifications: - Release the SslContext instances in a finally block so they are always released, even if an exception is thrown. Result: Fix possible SslContext leak in unit tests.
lltopk
pushed a commit
to lltopk/netty
that referenced
this pull request
Oct 24, 2026
…sts (netty#17597) (netty#17599) Motivation: testSslException and testFireChannelReadAfterHandshakeSuccess only released the server/client SslContext on the happy path, after latch.await() returned successfully. If an exception was thrown earlier (for example while binding or connecting), the SslContext and the native OpenSSL key material it holds were never released explicitly, and cleanup would only happen once the JVM finalizer ran. This races with the leak presence detector's afterAll check and can be reported as a flaky memory leak in this test class. Modifications: - Release the SslContext instances in a finally block so they are always released, even if an exception is thrown. Result: Fix possible SslContext leak in unit tests.
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.
Motivation:
testSslException and testFireChannelReadAfterHandshakeSuccess only
released the server/client SslContext on the happy path, after
latch.await() returned successfully. If an exception was thrown
earlier (for example while binding or connecting), the SslContext and
the native OpenSSL key material it holds were never released
explicitly, and cleanup would only happen once the JVM finalizer ran.
This races with the leak presence detector's afterAll check and can
be reported as a flaky memory leak in this test class.
Modifications:
always released, even if an exception is thrown.
Result:
Fix possible SslContext leak in unit tests.