Skip to content

EPERM error on Windows when multiple processes try to write the same fileΒ #28

@asapach

Description

@asapach

When write-file-atomic is used by multiple processes (e.g. in worker-farm) it can run into a race condition where the same file is being written/renamed concurrently. On Windows it causes the following error:

Error: EPERM: operation not permitted, rename '...' -> '...'

#22 seems to address this issue for async writes within the same process, but the issue still exists for parallel sync/async writes.

Here's a repro that demonstrates the problem: https://github.com/asapach/write-atomic-issue

Original issue: jestjs/jest#4444

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions