-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shutdownOutput()
for SSL connections prematurely closes the Channel (…
…#1502) Motivation: Before `RequestResponseCloseHandler` invokes `shutdownOutput()`, it forces `SslHandler` to close `SSLEngine` and send `close_notify` to the remote peer. Because `SSLEngine` is closed, `SslHandler` will generate `SslCloseCompletionEvent` on the next read regardless of receiving the `close_notify` alert from the remote peer or not. This premature event is handled incorrectly by the `DefaultNettyConnection` and forces the channel closure, breaking graceful closure handling on the server-side. Modifications: - Move handling of `SslCloseCompletionEvent` to the `CloseHandler` that is aware of the current state; - `RequestResponseCloseHandler` now ignores `SslCloseCompletionEvent` if it knows that the outbound was shutdown. It will wait for the `FIN` from remote peer to finish graceful closure; - Enhance `RequestResponseCloseHandlerTest` to validate new behavior; Result: 1. `shutdownOutput()` does not break graceful closure. 2. #1192 use-case `[4: protocol=HTTP_1 initiateClosureFromClient=false useUds=false viaProxy=true]` is not flaky anymore.
- Loading branch information
1 parent
ad7e8e1
commit 2bc89b5
Showing
5 changed files
with
105 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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