Files
fusion/.changeset/fix-task-json-tmp-race.md
gsxdsm 67c680c8d5 fix(FN-4122): use unique tmp filename for task.json atomic writes
Two TaskStore instances writing to the same task concurrently raced on a
shared task.json.tmp filename: one writer's rename consumed the tmp file,
the other ENOENTed. withTaskLock only serializes within a single store
instance, so cross-process writers (engine + dashboard server) were
unprotected.

Each write now uses task.json.<pid>.<uuid>.tmp and cleans up its own tmp
on rename failure. Adds a regression test that drives 40 concurrent
same-task updates across 4 TaskStore instances.

Fixes FN-4122, FN-4123, FN-4148.
2026-05-12 09:41:43 -07:00

6 lines
434 B
Markdown

---
"@runfusion/fusion": patch
---
Fix `ENOENT: ... rename 'task.json.tmp' -> 'task.json'` failures when two TaskStore instances (e.g. engine + dashboard server) write to the same task concurrently. The shared `task.json.tmp` filename caused one writer's `rename` to consume the tmp file and the other's to ENOENT. Each write now uses a unique tmp filename (`task.json.<pid>.<uuid>.tmp`) and cleans up its own tmp on rename failure.