mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
f05f642e89
deleteJSON was the one mutation path in the fs layer that neither used withWindowsRetry nor swallowed unlink errors. On Windows, unlink fails with a share-violation EPERM while a concurrent reader briefly holds the file open — hook polling races deleteAllHooksForRun by design — so a transient EPERM surfaced as a failed operation, e.g. a failed run.cancel(). Wrap the unlink in withWindowsRetry, matching the rename/link/unlink guards the write pipeline already has. ENOENT is not in the retryable set, so the already-deleted tolerance still short-circuits. Signed-off-by: Andrew Barba <barba@hey.com>
358 B
358 B
@workflow/world-local
| @workflow/world-local |
|---|
| patch |
Retry transient EPERM unlink failures on Windows when deleting hook and entity JSON files. A concurrent reader briefly holding a file open made deleteJSON throw a share-violation EPERM, which surfaced as a failed operation — for example a failed run.cancel() while deleteAllHooksForRun raced hook polling.