Distributed Lock Service · View 18 of 26 · 5 · Runtime
Decisions
- On the first failed keepalive the library stops handing out permission to start new units of work but lets in-flight work finish. A transient blip costs a pause, not an aborted batch.
- At the local deadline the library calls onFence. The deadline is the send time of the last successful keepalive plus the session TTL minus one second, measured on the monotonic clock.
- Using send time, not reply time, keeps the local deadline strictly earlier than the leader's expiry for that keepalive. The holder always believes it has lost the lock before the log says it has.
What this does not solve
- A pause that swallows the deadline itself. The library cannot run while the process is frozen, which is view 15 and the reason the token exists.
Rejected alternatives
- Abort at the first failure: safe, and throws away work on every 200 ms network blip.
- Continue until told: unsafe by construction. A partitioned holder is never told.