Lease extension
Latest stable Based on Leader release 0.4.0
Renew only while ownership still matches, and treat extension outcomes as operational decisions.
Automatic and explicit
Section titled “Automatic and explicit”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.
Outcome handling
Section titled “Outcome handling”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.
Safety rule
Section titled “Safety rule”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.
Release sources
Section titled “Release sources”leader-core/src/main/kotlin/io/bluetape4k/leader/LockExtender.ktleader-core/src/main/kotlin/io/bluetape4k/leader/ExtendOutcome.ktleader-core/src/main/kotlin/io/bluetape4k/leader/LeaderLeaseAutoExtender.kt