Build1 distinct publisher3 min readPublished
Locking-Center gets its whole ordering guarantee from a channel with capacity one, which is cheap and fair right up to the point where the single process holding that queue restarts and drops every key.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
A send on a channel with capacity one has two outcomes and no third. Either the slot is empty, the value goes in, and the call returns immediately, and that caller holds the key [4]. Or the slot is full, and the goroutine parks on that channel's send queue until a receive frees it [4]. The holder's unlock is that receive [3], and the freed slot wakes the next blocked sender [5]. Nothing in the server schedules the winner, because the runtime already keeps a FIFO wait queue behind every channel [6]. There is no condition variable and no ready-queue bookkeeping to get wrong [8].
It is good craft, but the guarantee stops at the process boundary. Ordering exists because one process owns the channel for a given key, and the author's own framing is that there is no consensus layer to operate [1]. So the fairness is single-node fairness. Before it transfers to your workload, every contending client must reach the same process, and you must be content with a property the post itself hedges as "roughly in arrival order" [6], enforced by a scheduler rather than by anything you can assert in a test. Held against a Redis SETNX retry loop, where spinning callers get no ordering at all [7], the claim stands. Held against a replicated lock service, it is a different question, and the post does not take it up.
The more instructive half of the design is the part that concedes the elegant version is broken. A parked send is unreachable: it cannot be canceled, timed out, or withdrawn [9]. Two ordinary events need to reach it anyway, an operator reset on a key a crashed client still holds, and a client that drops its connection while queued [10]. Hence a second structure, a map keyed by request id, which the author is careful to describe as a cancellation registry and not the queue [11]. A `select` then offers the parked waiter three exits where the bare send offered one [12], and the third exit is fed by a per-connection goroutine that reads until EOF and cancels the context [13]. The server withdraws the request and answers nobody, returning `io.EOF` [14]. Omit that path and the queue fills with ghosts, each handed a lock it will never release [15].
The arithmetic of that safety is small and worth stating: one channel per key, one map entry per queued request, one watcher goroutine per connection [2]. Server memory tracks contention rather than keyspace, which is the right way round for a lock.
Durability is where the bill lands. The lock table lives in memory by default, so a restart, including every deploy, drops every key and never tells the clients holding them [16], and the post says two of them can then end up inside the same critical section [17]. The word "default" implies a persistence mode; the section supplied does not describe one. Until it does, I would run this where a double write to the protected resource is something I could detect after the fact, and I would drain contenders before shipping the lock server. Deploying a lock server under contention is its own critical section.
Ranked by verification strength, evidence, and original report placement.
By default the Locking-Center lock table lives in memory, so a restart, including every deploy, drops every key and the clients holding them are never told.
The post states that after such a restart two clients can end up in the same critical section.
The author describes Locking-Center as a single binary with one dependency, no config file and no consensus layer to operate.
The author's stated goal was the lock as its own primitive: lock a key, do the work, unlock the key, and nothing else.
In Locking-Center every key gets a Go channel with a buffer of exactly one; sending into it acquires the lock and receiving from it releases the lock.
The first send fills the one-slot buffer and returns immediately, so that caller holds the key; the second and later sends have nowhere to go and block, and the blocked senders are the wait queue.
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 31, 2026
Follow any of these and your For You feed starts watching them — no settings page required.
build
Redlock's five masters are the price of a lock that survives failover1 distinct publisher
product
One team swapped HPA thresholds for a demand forecast after a 45-minute GPU node wait1 distinct publisher
build
One slow ZADD sets the p99 for every command in the pipeline1 distinct publisher
build
CAPTCHA walls in Playwright agent pipelines are usually self-inflicted retry bursts1 distinct publisher
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Code shown, nobody else looking
Almost every mechanical assertion arrives with the code that implements it — the capacity-one channel, the three-case select, the hang-up watcher, the persist-before-acknowledge ordering — which is more than most design write-ups offer. But it is one self-published post by the project's author, unreviewed, and the load the design carries most heavily, FIFO wakeup order behind a Go channel, is asserted rather than specified or measured.
Nobody says who runs it
Not one usage signal appears: no version or release, no downloads or stars, no named deployment, no benchmark, not even the author claiming to run Locking-Center himself. The post is entirely about how the thing is built. We leave this blank rather than read adoption into a design essay.
Fairness oversold, failure modes underplayed by nobody
The overstatement sits in one place. 'Blocking, FIFO-fair acquisition' is presented as falling out of the language for free, when Go promises no such thing and the author's own sentence softens to 'roughly'. Pulling hard the other way: the post hands the reader the worst thing about the software — that the default configuration can put two clients in one critical section across a deploy — which is not how a pitch behaves. Net, a modest tilt toward overstated, driven by an unverified ordering guarantee and the absence of any usage evidence at all.
The author grading his own design
One voice, and it belongs to the person who wrote the software, on a platform with no editor between draft and publish. The alternatives are dispatched in a paragraph each — Redlock has 'no' ordering guarantees, a fronting service means two queues — with no benchmark and no dissenting operator anywhere in sight. The candour about the in-memory failure mode is real and cuts against pure salesmanship, but self-disclosure is not outside scrutiny.
Checkable where it least matters
Arithmetic caps this: one publisher, who is the author. What a reader can verify — the code paths and the consequences the author draws from them — mostly holds. What would decide whether to run this, meaning ordering behaviour under real contention and whether anyone operates it today, is untested here.