Currently in testing: the GitHub code will be opened once complete.

R · Release

Structurerefresh

A lock release request. token is the fencing token that acquire returned, and the key is released only when it matches the token currently held. The response is Released R or Not Found N.

token — the Guard Against Releasing Someone Else's Lock

Without token verification, a dangerous sequence opens up. If a release request is being retried across a failover, and in the meantime the original lock is reclaimed by lease expiry and re-granted to a different client, that late-arriving release would unlock the new holder's lock. Releasing only on a token match closes this path.

If the token differs, N (not found) comes back and the lock stays held. Release retries must always carry the same token, and response matching also uses the echoed token (see Reply Matching Rules).

Byte notation: op is an ASCII character, token is binary (u64, big-endian), and key is UTF-8 text (variable-length, shown as N in the structure). The trailing \n is 0A. The fixed header is a binary value that may contain 0x0A, so it must be consumed by byte count first, before scanning for the newline.

Flow

Holder X
Server
Waiter Y
R · release (key · token)
R · released
if a waiter exists → A · direct handoff (new token)
if the key doesn't exist or the token differs
N · not found
requestresponse

If a waiter exists for the released key, it's handed directly to the front of the queue with no re-contention — separately from the R (released) sent to the releaser, the waiter gets an A (acquired) carrying a new token.