-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix recvfrom goroutine leak #793
Conversation
5a0e524
to
4def38d
Compare
About why old TestIfSocketCloses passed:
|
Looks like this one may have introduced a regression; see moby/moby#46982 (comment)
|
@thaJeztah IO calls on non-blocking sockets will never return Lines 848 to 860 in 9264582
I'm not very familiar with this project, but it seems to me that before this PR, only blocking IO is used. This PR adds calls to set the socket as non-blocking, but still allows setting the timeout socket options. |
Thanks; let me check with the networking folks about those parts. |
Tracing through the kernel sources, I can confidently claim that the timeout sockopts have no effect when the
The timeout for a non-blocking socket would be zero due to the Need further proof? The timeouts on new sockets are initialized to System calls that "shouldn't" return |
This all still feels very strange to me. I checked I actually rolled my own |
Unlike Go programs, Rust programs don't (inherently) have a runtime which sends SIGURG to the process baked in. |
Tokio does allow you to register for receiving signals. It's actually quite similar to |
This change breaks the timeouts, I can raise a PR to fix that. But, the Lines 582 to 584 in 9264582
|
unix.Recvfrom does not return after fd close.
Fixes #792