Repository navigation
WSL-Helper: make Linux vsock connection non-blocking. - #1374
Merged
ericpromislow merged 1 commit intoJan 28, 2022
Merged
Conversation
When we pipe the connection between the unix docker socket (/var/run/docker.sock) and the vsock socket, we need to open the vsock side as non-blocking so that once the unix side is closed we can close the vsock side properly. Otherwise the client would not be able to detect the socket should close. This copies an (Apache-2.0 licensed) file from github.com/linuxkit/virtsock so that we can make the resulting socket non-blocking. The only relevant change is in `func (v *vsockListener) Accept()` to add `SOCK_NONBLOCK`. Signed-off-by: Mark Yen <[email protected]>
ericpromislow
approved these changes
Jan 28, 2022
ericpromislow
left a comment
There was a problem hiding this comment.
This essentially calls unix.Accept4(v.fd, unix.SOCK_NONBLOCK) rather than unix.Accept(v.fd) and the prompt does return after a docker run -it ... ends. There's a slight delay before the prompt comes back, but I see that on macos without this change, so it's certainly normal.
This was referenced Jan 29, 2022
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.
When we pipe the connection between the unix docker socket (
/var/run/docker.sock) and the vsock socket, we need to open the vsock side as non-blocking so that once the unix side is closed we can close the vsock side properly. Otherwise the client would not be able to detect the socket should close.This copies an (Apache-2.0 licensed) file from github.com/linuxkit/virtsock so that we can make the resulting socket non-blocking. The only relevant change is in
func (v *vsockListener) Accept()to addSOCK_NONBLOCK.This should fix #1171.