-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Socket.Close() blocks indefinitely when Socket.ReceiveMessageFrom() is being called in another thread. #37873
Comments
Tagging subscribers to this area: @dotnet/ncl |
Update to this issue:
|
cc: @tmds |
@ShreyasZare can you try using .NET 5.0 preview? It has a change to improve this specifically: dotnet/corefx#38804. |
Thanks for the response. Good to know that the issue is being fixed in .NET 5.0 preview. I however cannot deploy with .NET 5.0 since its a product that will be distributed and is expected to work on all platforms. I have made a few workarounds for now that work well for the specific product use cases. |
fyi, calling |
For Udp Sockets it doesn't work. The product is actually a DHCP server so, everything it deals with is for Udp. |
@stephentoub this can be closed. This was fixed in .NET 5.0 (dotnet/corefx#38804). |
Can you check 5.0 as @tmds suggested @ShreyasZare? Feel free to reopen if you see problems with it. |
Any plans to backport to 3.1? I am hitting a similar issue. This time with Accept on a different thread to the Dispose. |
@prezaei any chance for you to use 5.0? |
Socket.Close() blocks indefinitely when Socket.ReceiveMessageFrom() is being called in another thread in Linux on .NET Core runtime v3.1.5.
The only way to release the block that I came up with is to send any UDP packet to the listening socket so that ReceiveMessageFrom() call returns and the socket closes.
Configuration
Regression?
This issue as far as I can tell did not come up when the original code was written and tested on .NET Core 2.2. It started to come up when the code was upgraded to .NET Core 3.1 and redeployed.
This issue does not affect Windows installations.
The text was updated successfully, but these errors were encountered: