EPERM error on Windows when multiple processes try to write the same file
Nobody has claimed this yet.
- #29 by @mekwall — closed without merging
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- operating-systems, tooling
Research direction
Start with the write-file-atomic behavior described in the issue and run the linked write-atomic-issue reproduction on Windows. Compare the existing handling referenced in #22 with concurrent sync and async writes from multiple processes; done means the reproduction no longer raises EPERM during concurrent writes or renames.
Written by the indexing model from the issue text.
Description
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: facebook/jest#4444
- Dominant language
- JavaScript
- Stars
- 256
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from npm/write-file-atomic
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
npm/write-file-atomic#245 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
npm/write-file-atomic#243 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
npm/write-file-atomic#224 ·
-
PornographyOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
npm/write-file-atomic#189 · 6 reactions ·
-
Bug Needs Triage
Difficulty 3/5 1-2 days Newbie friendliness 35/100
npm/write-file-atomic#163 ·
All issues in npm/write-file-atomic
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
scratchfoundation/scratch-editor#754 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 96/100
google/site-kit-wp#14102 ·
Maintainers usually reply within 2 days
-
area:growth priority:P1 type:docs
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
tecnologiasantos/bogoboom#66 ·
Maintainers usually reply within 1 day
-
desktop docs good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ktwu01/benchmark-radar#1181 ·
Maintainers usually reply within 1 day