Distributed Lock Service  ·  View 15 of 26  ·  5 · Runtime

The Pause Longer Than the Lease

The failure no lock protocol can prevent, and the single mechanism that makes it harmless.

Editable source SVG draw.io All views
Holder A Lock log Holder B Guarded resource 1. acquire 2. token 41 3. write · token 41 4. ok · high-water 41 5. stop-the-world pause 22 s 6. session lapses · revoke committed 7. acquire 8. token 57 9. write · token 57 10. ok · high-water 57 11. resumes · write · token 41 12. rejected · 41 ≤ 57 13. deadline passed → onFence The Pause Longer Than the Lease — Why the Token Exists No lock protocol prevents message 11. Only the resource can refuse it. v 1.0 · owner Platform Architecture · date 2026-09

What happens

  • Holder A is granted token 41, writes, then stops dead for 22 seconds: a garbage-collection pause, a VM migration, a throttled container. From outside that is indistinguishable from a crash.
  • Its session lapses, etcd commits the revocation, and B is granted token 57. B writes and the resource's high-water mark moves to 57.
  • A resumes believing it holds the lock and writes with 41. The resource rejects it. A's library notices its deadline passed and calls onFence, but only after the write was attempted.

Why nothing upstream fixes this

  • A cannot check its lease before writing, because the pause can land between the check and the write.
  • The service cannot wait longer before re-granting, because any bound it picks can be exceeded by a longer pause. Waiting for certainty turns a safety problem into a permanent availability problem.

What this implies

  • An advisory class accepts message 11. That is the whole meaning of advisory, and it is why advisory correctness classes are registered as risks.