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

Atomicity issues on node.js #12

Closed
swansontec opened this issue Nov 19, 2019 · 1 comment · Fixed by #13
Closed

Atomicity issues on node.js #12

swansontec opened this issue Nov 19, 2019 · 1 comment · Fixed by #13

Comments

@swansontec
Copy link
Contributor

swansontec commented Nov 19, 2019

As reported at EdgeApp/edge-core-js#258, concurrent writes through the Disklet node.js backend can leave corrupted data on disk, like {"encryptionType":0,"iv_hex":"KmI7"}nbccfS5KIQIGo9k2iPW3Zp8pxV2Zg4XGo5sG3qHCU="}:

One approach is to serialize the node.js backend, so new work goes in a queue and we only execute one task at once. Another approach would be to write files atomically, maybe using a library to do it.

@swansontec
Copy link
Contributor Author

Published the fix in v0.4.4.

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 a pull request may close this issue.

1 participant