madelson / DistributedLock

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

DistributedLock.Azure: Remove MaxNonInfiniteLeaseDuration #163

Closed trx1 closed 1 year ago

trx1 commented 1 year ago

Could the MaxNonInfiniteLeaseDuration restriction be removed? I would like to be able to set the duration to longer than one minute.

Reference: https://github.com/madelson/DistributedLock/blob/abb62f91024623b9975f04b6ac1eebef894364bf/src/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.cs#L15

My use case for DistributedLock is for running multiple services in a HA (high availability) environment where only one service is actively running (active/passive scenario). Due to the nature of the services they don't need to respond quickly to lock changes.

madelson commented 1 year ago

I think our hands are tied by Microsoft, see these docs.

That said, with auto-renewal (enabled by default) the underlying lease duration isn't terribly important.

trx1 commented 1 year ago

Ok, thanks.