-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
I'm just browsing the code, but isn't there a race condition when two processes encounter a stale lock at the same time?
Say p1 detects a stale lock and calls removeLock, but before it enters the function, is interrupted by the system.
In the meantime p2 detects the same stale lock and calls removeLock and succeeds. The same process, p2, then proceeds to acquireLock, creating a fresh directory. Now p1 receives CPU time and calls options.fs.rmdir, which was just created by p2 and calls acquireLock itself.
Both, p1 and p2, now believe that they successfully created the lock directory and proceed in parallel.
Metadata
Metadata
Assignees
Labels
No labels