Conversation
This allows failed connections from sockets (jruby#5709, jruby#5754) to raise the actual socket error even though the logic in socket.rb tries to close the failed socket. This approach differs from jruby#5713 in that it modifies the final flush logic to skip closed channels rather than modifying the IO#closed? logic to do that same check.
Member
Author
|
I have reverted the general change to IO since it appears to break too many things and doesn't match MRI semantics. The unusual case here is that using JDK sockets, several connection failures leave the channel in a closed state, unusable for further connecting but not nulled out as is needed for close to silently move on. I am making a narrower change now that cleans up the socket after any of these fatal connection failures, so it looks to the Ruby close logic like it has already been closed cleanly elsewhere. |
Because the case of a socket that fails to connect has special behavior for us (the socket is closed or never opened by JDK) we force it to clean up after a connect fails due to a ConnectException. This may be valid for other failures but I am limiting scope of this special case for now. See jruby#5754.
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.
This fixes issues from #5709 and #5754.