// the find
go-redsync/redsync
Distributed mutual exclusion lock using Redis for Go
Redsync implements the Redlock algorithm for distributed mutual exclusion in Go — multiple processes competing for the same named lock via Redis. You'd reach for this when you need to ensure exactly one worker runs a job across a fleet, and you already have Redis in your stack.
Supports multiple Redis client libraries (go-redis v7/v8/v9, redigo, rueidis, valkey) behind a clean Pool interface so you're not locked to one driver. The Lua scripts for acquire/release are atomic, which is the only correct way to implement this. Active maintenance — last push yesterday. Adopted by real projects (Sourcegraph, Google Open Match, gocron) which gives you some confidence it hasn't rotted in obscure edge cases.
The README's own disclaimer says the algorithm hasn't been formally analyzed — that's not a throwaway line, Martin Kleppmann wrote a detailed critique of Redlock arguing it doesn't provide safety guarantees under clock drift or GC pauses, and this library doesn't address that debate at all. There's no built-in context/cancellation support shown in the main example, which matters when you want to time-bound lock acquisition. The multi-node quorum use case (the whole point of Redlock over a single SETNX) is barely documented — if you're running a single Redis instance you're getting no meaningful distributed guarantees anyway. Travis CI badge links to a dead build; actual CI appears to be GitLab, which is a sign the repo's tooling isn't well-maintained even if the code is.