The problem with plain locks
If a client acquires a lock and then crashes, a simple lock stays held forever and no one else can proceed. Distributed systems cannot tell a crashed client from a slow one, so they need a time based escape.
Leases
A lease is a lock with an expiry. The holder gets it for a fixed duration and must renew it before it expires to keep holding it.
- If the holder keeps renewing, it retains the lease.
- If it crashes or stalls, the lease expires and the service frees it.
The renewal race
A holder should renew well before expiry to survive a slow network. If a renewal is late, the holder must assume it lost the lease and stop acting on it, because someone else may already have acquired it.
Key idea
A lease is a self expiring lock: holders renew to keep it, and a crashed holder automatically releases it, preventing permanent deadlock.