Repository navigation
fix(netty): map connection reset and aborted socket exceptions in NettyUtils - #12
Open
reginaldalfret wants to merge 1 commit into
Open
reginaldalfret wants to merge 1 commit into
reginaldalfret wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation and Context
In
NettyUtils.isConnectionResetException(Throwable), only exceptions containing the literal string"Connection reset by peer"were matched. On many operating systems and JDK implementations, TCP connection resets and abrupt teardowns throw:java.net.SocketException: Connection reset(standard JDK message without"by peer")java.io.IOException: An existing connection was forcibly closed by the remote host(Windows WSAECONNRESET 10054)java.io.IOException: An established connection was aborted by the software in your host machine(Windows WSAECONNABORTED 10053)Because these cases failed to match
isConnectionResetException,NettyUtils.decorateExceptionreturned the raw exception without attaching theCLOSED_CHANNEL_ERROR_MESSAGEcontext (closedChannelMessage(channel)), preventing actionable retry/proxy/TCP-dump diagnostics and causingServerConnectivityErrorMessageTestcases (DURING_INIT,DURING_SSL_HANDSHAKE) to fail across platforms.Modifications
NettyUtils.isConnectionResetException:originalCauseis anIOExceptionand its message is non-null."connection reset","forcibly closed by the remote host", and"connection was aborted".NettyUtilsTest:SocketException("Connection reset"),IOException("An existing connection was forcibly closed by the remote host"),IOException("An established connection was aborted by the software in your host machine"), and lowercase"connection reset"..changes/next-release/.Testing
NettyUtilsTest: 29 tests passed (0 failures, 0 errors).ServerConnectivityErrorMessageTest: all 16 test cases passed (0 failures, 0 errors).Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License