Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: atomic writing #1673

Merged
merged 3 commits into from
Jul 22, 2022
Merged

feat: atomic writing #1673

merged 3 commits into from
Jul 22, 2022

Conversation

Blu-J
Copy link
Contributor

@Blu-J Blu-J commented Jul 20, 2022

About

Renames are safer and are more atomic than just writing to a file.

Why not just using a tmp file:

  • What if the service is writing it's own .tmp files and the file names conflict? we could clobber them and cause weird bugs in the service
  • What if the service has behaviors that depend on stat-ing a directory? The new file could cause it to try to do something invalid

Proof it works

Nothing needs to change on the api side. Thus the old tests still working is proof that it works
image

libs/js_engine/src/lib.rs Outdated Show resolved Hide resolved
libs/js_engine/src/lib.rs Outdated Show resolved Hide resolved
libs/js_engine/src/lib.rs Outdated Show resolved Hide resolved
dr-bonez
dr-bonez previously approved these changes Jul 20, 2022
@dr-bonez dr-bonez force-pushed the feat/atomic-writes branch from 297d75f to 1bb4bc2 Compare July 21, 2022 21:20
@MattDHill MattDHill added this to the 0.3.1.1 milestone Jul 22, 2022
@dr-bonez dr-bonez merged commit c22c80d into master Jul 22, 2022
@MattDHill MattDHill deleted the feat/atomic-writes branch September 17, 2022 15:09
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.

3 participants