Skip to content
Leader docs0.4

Lease lifecycle

Latest stable Based on Leader release 0.4.0

Set wait, maximum lease, minimum hold, and extension from measured work rather than defaults.

waitTime bounds acquisition waiting. leaseTime bounds ownership. minLeaseTime prevents rapid reacquisition after a fast action and must not exceed the lease. autoExtend periodically renews supported single-leader leases while the action runs. Defaults are 5 seconds, 60 seconds, zero, and false.

Measure p99 action duration and backend latency. A fixed lease should cover p99 plus GC, scheduling, and network jitter. Keep wait time short for scheduled jobs that should skip, longer only when queueing is intentional. Use a minimum lease when downstream systems need spacing, not as a substitute for rate limiting.

Normal completion releases ownership with an owner token. A crash relies on TTL or session expiry. If work can outlive the lease, use supported auto-extension or split work into bounded checkpoints. Even with extension, downstream writes should be idempotent because no lease can eliminate every partition or pause race.