-
Notifications
You must be signed in to change notification settings - Fork 878
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
ProduceAsync Locking Up #939
Comments
My guess is tests are running concurrently and you're using a SyncrhonizationContext with a small number of threads. This could easily deadlock. You could try using |
I thought the xunit deadlock solution sounded good, but I tried it and it has not had any affect. I have written a ton of async framework code and I have never heard of ConfigureAwait until I started researching this ProduceAsync problem. The times I have seen async deadlock, it was happening 100% of the time, like from a WPF application. I have never seen it like this where it seems to happen only 25% of the time. I tried adding ConfigureAwait in a few places, but I think it will be tough to get them all. It did not help when I just added it in a few spots. |
a WPF SynchronizationContext is single threaded, guaranteeing a deadlock. |
We have the same issue after upgrading to 1.0.0 from 0.11.4:
Sure, the main problem was that we synchronously waited for task to complete (using @mhowlett, it would be great if we have a talk about this issue. |
whoops, it looks like i forgot to include them. thanks for working through this. closing in favor of #967, |
Description
When I call await ProduceAsync, it locks up indefinitely. I only wait for 1 minute. This sounds a lot like #545, but I am using the 1.0.0 Confluent NuGet.
I only see this when I run from my unit tests, which is xUnit on .Net Core 2.1. When I run the same code from a web application, it never locks up. Also, this does not happen 100% of the time. If I have a test that publishes 3 times synchronously, it could lock up on any one of the 3, or none at all. Oddly, it seems to happen less often when I run the test in Debug mode with VS, as opposed to when I run without debugging.
I am not getting any logs or errors from the producer during this lock up period.
How to reproduce
Call await ProduceAsync from an xUnit test in .Net Core.
The text was updated successfully, but these errors were encountered: