Skip to content
Leader docs0.4

Lease extension

Latest stable Based on Leader release 0.4.0

Renew only while ownership still matches, and treat extension outcomes as operational decisions.

autoExtend=true starts the shared watchdog for supported single-leader backends. Code inside an elected scope can also call LockExtender.extendActiveLockDetailed() or the suspend variant. Group auto-extension is not a general 0.4.0 contract.

Extended carries a best-effort observed expiry. NotHeld means token mismatch, expiry, or takeover. WrongThread is specific to a Redisson thread-bound lock used from another thread. BackendError preserves transient versus non-transient classification. The Boolean shortcut hides detail and should not drive an operator runbook.

The backend must extend atomically under the current owner condition. A user extension records its later deadline so the watchdog does not shorten it on the next tick. Stop protected writes when ownership is lost; renewing after expiry cannot retroactively make earlier work safe.