Skip to content

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

Merged
OndrejDrapalik merged 3 commits into
e2b-dev:mainfrom
adi-IL:fix/atomic-store-tempfile-collision
Sep 7, 2026
Merged

OndrejDrapalik merged 3 commits 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
Contributor

Concurrent writeRecord calls in one Node process used the same temporary path, causing overwrites and rename failures. Give each write its own temporary filename and remove it when writing or renaming fails. Existing shallow-merge behavior is unchanged.

Regression tests exercise 100 concurrent writes to one key, verify the final record is complete, check that no temporary files remain, and cover cleanup after a failed rename. Both targeted tests pass.

@cla-bot cla-bot Bot added the cla-signed label Aug 30, 2026

@OndrejDrapalik OndrejDrapalik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The per-write tempfile fix is scoped correctly, and the added regression tests cover concurrent writes, record integrity and failed-rename cleanup. Fresh CI passed on Ubuntu/macOS with Node 22/24, plus the Rust and version checks.

@OndrejDrapalik
OndrejDrapalik merged commit f5f5b6a into e2b-dev:main Sep 7, 2026
7 checks passed
@OndrejDrapalik OndrejDrapalik mentioned this pull request Sep 7, 2026
4 tasks
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.

2 participants