Skip to content
Latchkey

What Is a Distributed Lock?

A distributed lock provides mutual exclusion across separate processes or hosts, typically backed by a consensus store or coordination service. A process acquires the lock, performs its critical section, and releases it, while others wait. Robust implementations add lease timeouts and fencing tokens so a stalled holder cannot corrupt state.

Why it matters

Many workflows, such as running a migration once or applying infrastructure, must not execute concurrently across runners. A distributed lock enforces single execution even when the actors live on different machines.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →