-
Notifications
You must be signed in to change notification settings - Fork 768
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 bugs related to channel dispose while there are active calls #2120
Conversation
The changes look good. And the test as well. I also haven't been able to reproduce, I pulled your test and played around with it even, but nothing. |
|
Sracth my last comment, I can now reproduce this 100% reliably (of the 20 or so times I've executed my test, we might still get the ocassional success). @JamesNK the main issue with your test is that the HTTP handler does not return so GrpcCall.RunCall is awaiting for the response instead of for the GrpcCall.CallTask whose continuations are the ones that block the dispose thread. Hopefully you can run this with your changes and confirm that releasing the lock earlier is indeed a fix. |
Good find. I've updated the test in the PR. I confirmed the test deadlocked on my machine before the changes and succeeded after the changes. |
Fixes #2119
@amanda-tarafa I tried to recreate this in a unit test without success. I went with your suggestion. Also, I modified the dispose check when starting gRPC calls to remove the chance of a new active call being added after dispose.Update: Deadlock reproduced in a unit test. Fix in PR confirmed to work.
This PR fixes a number of bugs related to disposing a channel while there are ongoing active calls:
ObjectDisposedException
after channel dispose.