GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — Resume SslHandler when the delegated task was consumed elsewhere by normanmaurer · Pull Request #18372 · netty/netty Conversation
|
✅ All tests passed ✅🏷️ Commit: 983cd0f Learn more about TestLens at testlens.app/docs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Auto-port PR for 4.2: #18406 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Auto-port PR for 5.0: #18407 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… elsewhere (#18407) Auto-port of #18372 to 5.0 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. Co-authored-by: Norman Maurer <[email protected]>
… elsewhere (#18406) 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. Co-authored-by: Norman Maurer <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.