-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
unblock Unix Domain Socket on Dispose on macOS #101753
Conversation
Tagging subscribers to this area: @dotnet/ncl |
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SafeSocketHandle.Unix.cs
Outdated
Show resolved
Hide resolved
Note that the linked issue can also be fixed by adding |
|
||
try | ||
{ | ||
client.Receive(buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a regression that causes TryUnblockSocket
to break, the test will hang at client.Receive
and never time out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do some things like:
runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceive.cs
Lines 1079 to 1088 in 5d05361
await Task.WhenAny(disposeTask, socketOperation) | |
.WaitAsync(TimeSpan.FromMilliseconds(TestSettings.PassingTestTimeout)); | |
await disposeTask | |
.WaitAsync(TimeSpan.FromMilliseconds(TestSettings.PassingTestTimeout)); | |
SocketError? localSocketError = null; | |
try | |
{ | |
await socketOperation | |
.WaitAsync(TimeSpan.FromMilliseconds(TestSettings.PassingTestTimeout)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about it. However, I think we would notice it and fix it. XUnit now spits out warnings about long running tasks.
src/libraries/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs
Show resolved
Hide resolved
* unblock Unix Domain Socket on dispose on macOS * feedback * feedback * windows * feedback
* unblock Unix Domain Socket on dispose on macOS * feedback * feedback * windows * feedback
fixes #101539
When.
Interop.Sys.Disconnect
is called on macOS with UDS, it fails and we end up in endlessTryUnblockSocket
loop.We could fallback to
Shutdown
on any error - this is just smallest change to fix the reported issue.,Lot of the abortive jargon around here really make sense only for TCP imho and I'm n to sure how applicable the logic is to other socket types.