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 — Fix flaky memory leak detection in OcspServerCertificateValidatorTest by normanmaurer · Pull Request #17536 · netty/netty

Conversation

@normanmaurer

@normanmaurer normanmaurer commented Sep 18, 2026

Copy link
Copy Markdown
Member

Motivation:

The server-side child channel accepted for the TLS connection in
validateCertificate() was never closed explicitly. Its cleanup depended
entirely on the local EventLoopGroup's shutdownGracefully(0, 1, SECONDS),
which cancels scheduled tasks as soon as shutdown begins. Under CI load the
SslHandler close_notify flush/timeout could lose that race, leaving the
SSLEngine and its cached key material to be released later by GC
finalization instead, which intermittently tripped the leak presence
detector's 5 second grace period.

Modifications:

  • Capture the accepted server-side child channel and close it explicitly
    before releasing serverSslContext and shutting down the group

Result:

More stable CI

Sorry, something went wrong.

Uh oh!

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

All reactions
@normanmaurer
Fix flaky memory leak detection in OcspServerCertificateValidatorTest
6bd4d9c
Motivation:

The server-side child channel accepted for the TLS connection in
validateCertificate() was never closed explicitly. Its cleanup depended
entirely on the local EventLoopGroup's shutdownGracefully(0, 1, SECONDS),
which cancels scheduled tasks as soon as shutdown begins. Under CI load the
SslHandler close_notify flush/timeout could lose that race, leaving the
SSLEngine and its cached key material to be released later by GC
finalization instead, which intermittently tripped the leak presence
detector's 5 second grace period.

Modifications:

- Capture the accepted server-side child channel and close it explicitly
  before releasing serverSslContext and shutting down the group

Result:

More stable CI
@normanmaurer
normanmaurer requested a review from chrisvest September 18, 2026 13:49
@normanmaurer normanmaurer assigned yawkat Sep 18, 2026
@normanmaurer normanmaurer added the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 18, 2026
@normanmaurer normanmaurer added this to the 4.2.19.Final milestone Sep 18, 2026
@normanmaurer

normanmaurer commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

Hopefully this fixes the last leak

All reactions

Sorry, something went wrong.

Uh oh!

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

@testlens-app

testlens-app Bot commented Sep 18, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

✅ All tests passed ✅

⚠️ TestLens detected flakiness ⚠️

Test Summary

Build PR / windows-x86_64-java11-boringssl > Netty/Common

Test Runs Flakiness
AutoScalingEventExecutorChooserFactoryTest > testScaleUp() ❌ ✅ 1% 🟡

🏷️ Commit: 6bd4d9c
▶️ Tests: 41103 executed
⚪️ Checks: 28/28 completed

Test Failures

AutoScalingEventExecutorChooserFactoryTest > testScaleUp() (Netty/Common in Build PR / windows-x86_64-java11-boringssl | Attempt 1/2)
org.opentest4j.AssertionFailedError: Should scale up to 2 after stressing one executor. ==> expected: <2> but was: <3>
	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.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:563)
	at io.netty.util.concurrent.AutoScalingEventExecutorChooserFactoryTest.testScaleUp(AutoScalingEventExecutorChooserFactoryTest.java:152)
	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)
expected actual
2 3

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 9f4dc37 into 4.2 Sep 19, 2026
44 of 45 checks passed

Uh oh!

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

@normanmaurer
normanmaurer deleted the ocsp_test_leak_fixes branch September 19, 2026 14:55
@netty-project-bot

netty-project-bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #17546

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-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 19, 2026
@netty-project-bot netty-project-bot mentioned this pull request Sep 19, 2026
Auto-port 5.0: Fix flaky memory leak detection in OcspServerCertificateValidatorTest #17546
Merged
normanmaurer added a commit that referenced this pull request Sep 20, 2026
@netty-project-bot @normanmaurer
Auto-port 5.0: Fix flaky memory leak detection in OcspServerCertifica…
c849baf
…teValidatorTest (#17546)

Auto-port of #17536 to 5.0
Cherry-picked commit: 9f4dc37

---
Motivation:

The server-side child channel accepted for the TLS connection in
validateCertificate() was never closed explicitly. Its cleanup depended
entirely on the local EventLoopGroup's shutdownGracefully(0, 1,
SECONDS),
which cancels scheduled tasks as soon as shutdown begins. Under CI load
the
SslHandler close_notify flush/timeout could lose that race, leaving the
SSLEngine and its cached key material to be released later by GC
finalization instead, which intermittently tripped the leak presence
detector's 5 second grace period.

Modifications:

- Capture the accepted server-side child channel and close it explicitly
  before releasing serverSslContext and shutting down the group

Result:

More stable CI

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

@chrisvest chrisvest Awaiting requested review from chrisvest

Uh oh!

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

Assignees

@yawkat yawkat

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.

3 participants

@normanmaurer @netty-project-bot @yawkat
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.