-
Notifications
You must be signed in to change notification settings - Fork 132
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
[bug] AsyncAutoResetEvent deadlocks #82
Comments
using |
@jasonswearingen , thanks for the report! Regardless of potential bug, I'm trying to figure out what happening in your test. I would appreciate if you can help me with that. I see the following:
I see that Producer thread has no async code (no await operators). Moreover, the test waits for Producer completion only. So I'm not sure how |
yes you are correct regarding the test workflow. And yes, there is a small bug in the test that would leave the consumer task stalled if the deadlock did not exist. The last line should have: await producerTask;
autoResetEvent.Set(); I have updated the test code accordingly. |
Also, there is an interesting bug in .NET itself that was fixed: dotnet/runtime#60182. It is observable for very small timeouts only. 1 milliseconds is enough to blow up on that mine. Unfortunately, the fix is not included in .NET 6 RC2. Timeout tracking in all asynchronous primitives rely on |
@jasonswearingen , maybe await producerTask;
autoResetEvent.Set();
await consumerTask; ? |
sure that would be better :) btw when I ran it, the producer thread is hung inside the |
Unfortunately, we have to wait for final release of .NET 6 and then check again. |
@jasonswearingen , .NEXT RC1 has been released. It uses GA version of .NET 6 so you can try tests again. |
The bug is still there. deadlocks in same location. tested with dotnet6.0 release and dotNext |
I found the root cause:
|
According to sources in .NET repo, |
@jasonswearingen , many thanks for reporting this bug! The potential fix is in |
Run this test. On my computer, it deadlocks after about 6 seconds
using DotNext 4.0.0-beta.8 from Nuget
The text was updated successfully, but these errors were encountered: