You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An owner that exits while its unlock cannot run leaves the key held with no record #43
An owner that exits while its unlock cannot run leaves the key held with no record. The owner DOWN handler ignores the result of the unlock and deletes the record, so if the lock connection stalls while idle, the unlock queues behind the pool's ping and is dropped after about 4 to 6 s, and if the stall ends before the 15 s ping timeout, the live session keeps the key, nothing is logged, nothing retries the unlock, and other nodes get :lock_already_taken until that connection ends. If the subscription starts again on the same node, it takes the key once more, so it stays pinned to that node, and later stops on a healthy connection still leave the key held. release/2 keeps a failed unlock and retries it. Same at 19072b4. Low: it needs a stall of several seconds with a subscription stopping during it.
Fixed by #61. When an owner exits and its unlock cannot run, the lock server now keeps retrying that unlock until the lock is released, as release/2 already did, instead of dropping the record and leaving the key held.
Verified with test/advisory_locks_test.exs ("should retry the unlock of an owner that terminates until the lock is released"): it fails against the code before #61 and passes on main.
Activity
yordis commentedon Oct 27, 2026
Fixed by #61. When an owner exits and its unlock cannot run, the lock server now keeps retrying that unlock until the lock is released, as
release/2already did, instead of dropping the record and leaving the key held.Verified with
test/advisory_locks_test.exs("should retry the unlock of an owner that terminates until the lock is released"): it fails against the code before #61 and passes on main.