madelson / DistributedLock

A .NET library for distributed synchronization
MIT License
1.75k stars 182 forks source link

Azure leases expire #141

Open gliljas opened 1 year ago

gliljas commented 1 year ago

Hi! We've recently switched to this beautiful library from having an inhouse developed implementation with Azure blob leases. Unfortunately we now see a lot of "A lease ID was specified, but the lease for the blob has expired." in production. It's thrown by DeleteIfExistsAsync, i.e during disposal.

I'm experimenting with different cadence settings, but would like to raise the issue anyway.

madelson commented 1 year ago

@gliljas thanks for your interest in the library. I wonder if you're running into https://github.com/madelson/DistributedLock/issues/132 ? Could you post the full error detail (exception.ToString())?

It would also be useful to see some code snippets showing your setup (what options are you using, how are you creating/acquiring/releasing the lock, etc).

Finally, are you subscribing to the HandleLostToken on the handle? Is it firing?