You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A granted lock is never released after over a day.
Using the following code:
var myLock = new SqlDistributedLock($"ProductsJob_<Id>, "ConnectionString");
using (var handle = await myLock.TryAcquireAsync(TimeSpan.FromHours(1)))
...
After killing the lock
KILL 65
The lock is released an application continues to work.
It's only happened twice in the last year and this process is run every 15 minutes.
Wow I guess we might we waiting a long time for a repro, then. I wonder if it could be reproduced more quickly by a unit test acquiring and releasing in a tight loop.
Can you tell me more about your setup?
How many threads/processes are typically contending for the lock?
Is it common for Acquire to block or is there usually no contention?
How long does each thread hold the lock for before releasing it?
Have you tried releasing locks asynchronously using await using?
Activity
madelson commentedon Dec 22, 2021
Hi @gtaylor44 thanks for reporting. Without more information it is going to be difficult to investigate the issue.
In this situation, I can think of several possible options:
To start, it would be great to add some logging to your code so that we can start to narrow this down (perhaps you've already done this).
Also, can you confirm that you're seeing this behavior with the newest version of the library?
gtaylor44 commentedon Dec 22, 2021
Thanks @madelson
I will add some additional logging. It's only happened twice in the last year and this process is run every 15 minutes.
gtaylor44 commentedon Dec 22, 2021
@madelson
I'm currently on version 2.1.0
The last time I updated was when I first encountered this issue. I will update to 2.3.0 in the meantime.
madelson commentedon Dec 23, 2021
Wow I guess we might we waiting a long time for a repro, then. I wonder if it could be reproduced more quickly by a unit test acquiring and releasing in a tight loop.
Can you tell me more about your setup?
await using?madelson commentedon Nov 6, 2022
@gtaylor44 any chance you've seen this come up again?