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

Aperta
#28 6 commenti 9 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

  • #29 di @mekwall — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
JavaScript
Stelle
256
Fork
51
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di npm/write-file-atomic

Tutte le issue di npm/write-file-atomic

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.