-
Notifications
You must be signed in to change notification settings - Fork 56
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
Disposing ZeebeClient causes crashing in async code #105
Comments
Thanks @0x15e for reporting I will try to take a look at it next week. |
I believe this PR will fix this; #104 As far as I could see, the problem isn't actually the Wait-mehod on |
@bulldetektor If it was just throwing that would be one thing, but no exception comes out of that call that I've been able to catch. Even when I have the debugger set to break on all exceptions, it doesn't catch anything on the |
@0x15e Not all exceptions are "catchable", but I belive you could try to set up an eventhandler for any unhandled exceptions and see if you can put a breakpoint there. Something like this;
|
@bulldetektor Interesting. TIL. Well you guys know the code better than I do so I'll leave the fixing to you. |
@0x15e I'm in no way entitled to claim that I know this code base, and I agree with you that it would be nice to to have the "async dispose" of netstandard2.1. But that would be a pretty heavy breaking change, and so should probably be done by multi-targeting both netstandard 2.0 and 2.1. But I'll leave that decision to @Zelldon :) |
I would assume this is fixed, at least I can't reproduce it with the given example. |
Describe the bug
The blocking call to
channelToGateway.ShutdownAsync().Wait()
causes the application to terminate (exit code 6) at the next async call when used within an async context.To Reproduce
Create a C# console application and reference zb-client 0.15.0 (this can also be reproduced using the code in master). Add the following code to the Program.cs file:
Expected behavior
Disposing the Zeebe client should not crash the application.
Enviroment (please complete the following information):
Additional context
I can provide the complete core dump that goes with the crash if you think that would be helpful.
With some testing, I found that this can be solved by retargeting zb-client to
netstandard2.1 and implementing
IAsyncDisposable
onZeebeClient
(instead ofIDisposable
), with theDisposeAsync
method as follows:This allows appropriate async disposal using
await using
statements or even justawait zeebeClient.DisposeAsync();
. It does, however, present the challenge of implementingIAsyncDisposable
while still maintaining netstandard2.0 support.The text was updated successfully, but these errors were encountered: