Skip to content

fix: prevent intra-process tempfile collisions in atomic store writes - #33

Open
adi-IL wants to merge 1 commit into
e2b-dev:mainfrom
adi-IL:fix/atomic-store-tempfile-collision
Open

fix: prevent intra-process tempfile collisions in atomic store writes#33
adi-IL wants to merge 1 commit into
e2b-dev:mainfrom
adi-IL:fix/atomic-store-tempfile-collision

Conversation

@adi-IL

@adi-IL adi-IL commented Aug 30, 2026

Copy link
Copy Markdown

writeRecord writes record state to ${recordPath(key)}.tmp.${process.pid} before renaming it into place.

When rapid asynchronous events occur within the same Node.js process (e.g. concurrent state updates or logging hooks), concurrent calls share the exact same temporary filename. This can cause partial overwrites and rename failures.

Use a unique per-operation nonce for the temporary file and clean up on write errors.

@cla-bot cla-bot Bot added the cla-signed label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant