Skip to content

task-store.ts: make restoration from cache atomic#242

Open
imaman wants to merge 1 commit into
mainfrom
atomic
Open

task-store.ts: make restoration from cache atomic#242
imaman wants to merge 1 commit into
mainfrom
atomic

Conversation

@imaman
Copy link
Copy Markdown
Owner

@imaman imaman commented Jan 27, 2026

No description provided.

Previously, cache restoration would delete the output directory first,
then extract files one by one. This created a window where other tasks
could see a partially-restored state, causing sporadic "module not found"
errors when a task tried to import from a package whose cache restoration
was still in progress.

Now we extract to a temporary directory first, then atomically move each
output to its final location using fs.rename (which is atomic when source
and dest are on the same filesystem).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@imaman imaman changed the title tbd task-store.ts: make restoration from cache atomic Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant