Skip to content

Commit 06e6bf9

Browse files
cliffhallclaude
andcommitted
fix(memory): treat only EPERM as a lock being deleted on Windows
Node reports a pending delete on Windows as EPERM. Counting EACCES as well turned a real EACCES on the break guard into a timeout, failing "fails when the breaking guard cannot be created" on the Windows leg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
1 parent a6c2682 commit 06e6bf9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎src/memory/index.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,12 @@ function ignoreError(): void {}
139139

140140
// Whether opening a lock file failed because the file is held right now. On
141141
// Windows, opening a file that another process is still deleting fails with
142-
// EPERM (or EACCES) rather than EEXIST until the deletion completes, so there
143-
// those mean "held" too.
142+
// EPERM rather than EEXIST until the deletion completes, so there EPERM means
143+
// "held" too.
144144
function isLockBusy(error: unknown): boolean {
145145
const code = (error as NodeJS.ErrnoException).code;
146146
return (
147-
code === "EEXIST" ||
148-
(process.platform === "win32" && (code === "EPERM" || code === "EACCES"))
147+
code === "EEXIST" || (process.platform === "win32" && code === "EPERM")
149148
);
150149
}
151150

0 commit comments

Comments
 (0)