Manually set initial TCP socket readiness - #5299
Merged
Merged
Conversation
RalfJung
reviewed
Sep 5, 2026
Member
There was a problem hiding this comment.
Thanks! Nice catch.
However I am not sure yet about the fix.
@rustbot author
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
Contributor
Author
|
@rustbot ready |
Member
|
This looks great, thanks! Please squash the commits. You can squash manually if there are multiple independent commits you want to preserve, or use @rustbot author |
Because shimmed TCP sockets only receive host readiness events after `connect` or `listen` has been invoked, we need to manually set the initial readiness of a TCP socket.
WhySoBad
force-pushed
the
default-tcp-socket-readiness
branch
from
September 5, 2026 19:09
34b0c91 to
a12a6d0
Compare
Contributor
Author
|
@rustbot ready |
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.
The current TCP socket implementation doesn't report the correct readiness before an underlying host TCP socket exists.
This PR thus manually sets the "read closed", "write closed", and "writable" readiness for a newly created socket. This initial readiness gets "silently cleared" once an underlying host socket is created.
The newly added test would cause a global deadlock prior to this change.