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 — Auto-port 4.2: Resume SslHandler when the delegated task was consumed elsewhere by netty-project-bot · Pull Request #18406 · netty/netty

Conversation

@netty-project-bot

@netty-project-bot netty-project-bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Auto-port of #18372 to 4.2
Cherry-picked commit: 63ac5f2


Motivation:

SslTasksRunner.run() returns silently when SSLEngine.getDelegatedTask() returns null, treating it as "the task was processed in the meantime". Nobody is guaranteed to call runComplete() in that case, so STATE_PROCESS_TASK stays set forever. decode() and flush() then return early for every subsequent call and the handshake stalls until it times out, even though the engine is ready to make progress.

Modification:

When getDelegatedTask() returns null, hop onto the EventExecutor and resume if STATE_PROCESS_TASK is still set. We only run one task at a time (STATE_PROCESS_TASK makes decode() and flush() return early while it is set), so there is no other runner that could still be executing a task and we can always resume. If the state was already cleared, somebody else resumed and we do nothing.

Add a regression test that uses an SSLEngine which consumes the first delegated task itself and returns null for it. Without the fix the handshake never completes.

Result:

The handshake can no longer get stuck when a delegated task was consumed before the SslTasksRunner got to run it.

Note: I could not find a code path in SslHandler that reaches this branch with the JDK engine or ReferenceCountedOpenSslEngine today, so this is a hardening change. It was found while looking at a timed out KQueueSocketSslEchoTest on #18368 and is not shown to be the cause of it.

Tested with ./mvnw -pl handler -am test -Dtest=SslHandlerTest (59 run, 0 failures, 1 skipped; checkstyle ran as part of it). The new test fails without the change.

Sorry, something went wrong.

Uh oh!

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

All reactions
@normanmaurer @netty-project-bot
Resume SslHandler when the delegated task was consumed elsewhere (#18372
827acb4
)

Motivation:

`SslTasksRunner.run()` returns silently when
`SSLEngine.getDelegatedTask()` returns `null`, treating it as "the task
was processed in the meantime". Nobody is guaranteed to call
`runComplete()` in that case, so `STATE_PROCESS_TASK` stays set forever.
`decode()` and `flush()` then return early for every subsequent call and
the handshake stalls until it times out, even though the engine is ready
to make progress.

Modification:

When `getDelegatedTask()` returns `null`, hop onto the `EventExecutor`
and resume if `STATE_PROCESS_TASK` is still set. We only run one task at
a time (`STATE_PROCESS_TASK` makes `decode()` and `flush()` return early
while it is set), so there is no other runner that could still be
executing a task and we can always resume. If the state was already
cleared, somebody else resumed and we do nothing.

Add a regression test that uses an `SSLEngine` which consumes the first
delegated task itself and returns `null` for it. Without the fix the
handshake never completes.

Result:

The handshake can no longer get stuck when a delegated task was consumed
before the `SslTasksRunner` got to run it.

Note: I could not find a code path in `SslHandler` that reaches this
branch with the JDK engine or `ReferenceCountedOpenSslEngine` today, so
this is a hardening change. It was found while looking at a timed out
`KQueueSocketSslEchoTest` on #18368 and is not shown to be the cause of
it.

Tested with `./mvnw -pl handler -am test -Dtest=SslHandlerTest` (59 run,
0 failures, 1 skipped; checkstyle ran as part of it). The new test fails
without the change.

(cherry picked from commit 63ac5f2)
@netty-project-bot netty-project-bot mentioned this pull request Nov 13, 2026
Resume SslHandler when the delegated task was consumed elsewhere #18372
Merged
@testlens-app

testlens-app Bot commented Nov 14, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 827acb4
▶️ Tests: 150837 executed
⚪️ Checks: 27/27 completed


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.

@chrisvest chrisvest added this to the 4.2.21.Final milestone Nov 14, 2026
@chrisvest
chrisvest merged commit 5640e63 into 4.2 Nov 14, 2026
28 checks passed

Uh oh!

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

@chrisvest
chrisvest deleted the auto-port-pr-18372-to-4.2 branch November 14, 2026 01:42
@lhotari lhotari mentioned this pull request Nov 17, 2026
[improve][build] Upgrade Netty to 4.2.21.Final to restore the aarch64 glibc floor and pick up bug fixes apache/pulsar#27654
Merged
1 of 11 tasks
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.21.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

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