Skip to content

Fix leak in SniHandlerTest#16367

Merged
normanmaurer merged 1 commit into
netty:4.2from
chrisvest:4.2-fix-snihandlertest
Feb 26, 2026
Merged

Fix leak in SniHandlerTest#16367
normanmaurer merged 1 commit into
netty:4.2from
chrisvest:4.2-fix-snihandlertest

Conversation

@chrisvest

Copy link
Copy Markdown
Member

Motivation:
We see this SniHandlerTest often fail with a leak being detected.

Modification:

  • Make sure to wait for the server to shut down, so the leak presence detector isn't racing with the shutdown of the server child channel.
  • Make sure to release any SslContext objects we create, if later ones throw exceptions.
  • Propagate any connect exceptions by awaiting with sync.

Result:
Hopefully more stable SniHandlerTest and no more leaks.

Motivation:
We see this SniHandlerTest often fail with a leak being detected.

Modification:

- Make sure to wait for the server to shut down, so the leak presence detector isn't racing with the shutdown of the server child channel.
- Make sure to release any `SslContext` objects we create, if later ones throw exceptions.
- Propagate any connect exceptions by awaiting with `sync`.

Result:
Hopefully more stable `SniHandlerTest` and no more leaks.
@chrisvest chrisvest added this to the 4.2.11.Final milestone Feb 25, 2026
@chrisvest chrisvest 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 Feb 25, 2026
@normanmaurer normanmaurer merged commit fb4cd81 into netty:4.2 Feb 26, 2026
23 checks passed
@netty-project-bot

Copy link
Copy Markdown
Contributor

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

@netty-project-bot

Copy link
Copy Markdown
Contributor

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

normanmaurer pushed a commit that referenced this pull request Feb 26, 2026
Motivation:
We see this SniHandlerTest often fail with a leak being detected.

Modification:

- Make sure to wait for the server to shut down, so the leak presence
detector isn't racing with the shutdown of the server child channel.
- Make sure to release any `SslContext` objects we create, if later ones
throw exceptions.
- Propagate any connect exceptions by awaiting with `sync`.

Result:
Hopefully more stable `SniHandlerTest` and no more leaks.
normanmaurer pushed a commit that referenced this pull request Feb 26, 2026
Motivation:
We see this SniHandlerTest often fail with a leak being detected.

Modification:

- Make sure to wait for the server to shut down, so the leak presence
detector isn't racing with the shutdown of the server child channel.
- Make sure to release any `SslContext` objects we create, if later ones
throw exceptions.
- Propagate any connect exceptions by awaiting with `sync`.

Result:
Hopefully more stable `SniHandlerTest` and no more leaks.
@normanmaurer

Copy link
Copy Markdown
Member

Port for 5.0: #16376
Port for 4:1 #16377

normanmaurer added a commit that referenced this pull request Feb 26, 2026
Motivation:
We see this SniHandlerTest often fail with a leak being detected.

Modification:

- Make sure to wait for the server to shut down, so the leak presence
detector isn't racing with the shutdown of the server child channel.
- Make sure to release any `SslContext` objects we create, if later ones
throw exceptions.
- Propagate any connect exceptions by awaiting with `sync`.

Result:
Hopefully more stable `SniHandlerTest` and no more leaks.

Co-authored-by: Chris Vest <christianvest_hansen@apple.com>
normanmaurer added a commit that referenced this pull request Feb 26, 2026
Motivation:
We see this SniHandlerTest often fail with a leak being detected.

Modification:

- Make sure to wait for the server to shut down, so the leak presence
detector isn't racing with the shutdown of the server child channel.
- Make sure to release any `SslContext` objects we create, if later ones
throw exceptions.
- Propagate any connect exceptions by awaiting with `sync`.

Result:
Hopefully more stable `SniHandlerTest` and no more leaks.

Co-authored-by: Chris Vest <christianvest_hansen@apple.com>
@chrisvest chrisvest deleted the 4.2-fix-snihandlertest branch February 26, 2026 17:51
@chrisvest chrisvest removed 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 Feb 26, 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.

3 participants