-
Notifications
You must be signed in to change notification settings - Fork 197
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
SqlDistributedLockHandle.HandleLostToken blocks current thread indefinitely-ish #85
Comments
Thanks for reporting @joshua-mng. Can you show the code used to create |
It is SqlServer provider. I am just passing my connection string to build the provider. No extra options are provided.
|
Ok great I've been able to reproduce this:
|
I've tracked down the root cause for this and should have a fix soon. The sequence of events is:
|
I am using your library to implement a leader election algorithm, and it's working so well, thanks for the wonderful work.
Here is a certain section of my code:
When this method runs, it blocks on
handle.HandleLostToken
for very very long time (i guess indefinitely).But when I access that property on another thread like this, it works like a charm.
And also, when app shuts down, when I call
_lockHandle.DisposeAsync
method in another method, it either blocks or succeeds depending on whether I accessed_lockHandle.HandleLostToken
property. In the first section of code (where I didn't access_lockHandle.HandleLostToken
)_lockHandle.DisposeAsync
method works without blocking, but in the second section of code where I'm accessing_lockHandle.HandleLostToken
, it blocks.I think there is some kind of synchronization context dead lock or something here. Thanks
The text was updated successfully, but these errors were encountered: