Skip to content

Archive

Fencing Tokens

1 articles
Software Engineering 20 Sep 2026 7 min read

Fencing Tokens Block Stale Lock Holders at the Resource

Fencing Tokens Block Stale Lock Holders at the Resource A distributed lease can expire while its holder is still running. A process may pause for garbage collection, lose contact with the coordinator, stall under scheduler pressure, or resume after a machine suspension. The lock service can correctly grant the lease to another worker while the old worker still has unfinished work. That gap matters when both workers can reach the protected resource. A lease controls ownership in the coordinator; it does not automatically revoke a delayed database connection, storage request, or RPC that was prepared by the previous holder.