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
packages/lock: negative timeout should wait forever, adapters treat it as no-wait #13719
Utopia\Lock\Lock::acquire() documents its contract as: 0.0 means do not wait, a negative value means wait forever.
File::acquire() returns $this->tryAcquire() for every $timeout <= 0.0, so a negative timeout is a single non-blocking attempt. Under contention a caller following the documented contract gets an immediate false, or a Contention exception from withLock(), instead of waiting. The Redis Distributed adapter and the non-coroutine Mutex and Semaphore paths have the same shape.
Either the adapters honour negative as unbounded, or the interface doc drops the negative case; pick one and cover it with a unit test on the file lock (contention from a second process or a pre-held handle, negative timeout, assert it blocks until release).
Found by review on #13718 while absorbing the package; left out of that PR because absorption does not change library behaviour. The library now lives at packages/lock, so the fix lands here and releases with bin/monorepo release lock.
Activity
fix: address the review and CI on the lock absorb
piyushthawale19 commentedon Oct 2, 2026
Hi! I'd like to work on this issue. Could you please assign it to me?