How it works
Lease, not forever
The lock expires unless its owner renews it, allowing the system to recover when a process crashes while holding ownership.
Compare before release
A client releases only the token it acquired, so a delayed cleanup cannot delete a newer client lock.
Fencing tokens
Each acquisition receives an increasing number that storage or workers use to reject stale operations from former owners.
Prefer less coordination
Idempotency, database constraints, partition ownership, or optimistic concurrency are often simpler than a cross-system lock.