-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
request: add option to call fsync() when closing files #49886
Comments
/cc @nodejs/fs |
For For See also #28513 about interleaving |
I think adding an option to @bnoordhuis as a side note, I have been experiencing significant read-after-write issues when using Node.js fs APIs since the move to IO_URING. It's too fast and the filesystem is not flushed. |
I think writeFile and fs.WriteStream makes sense (especially writeFile) |
In addition to
|
This commit adds a 'flush' option to the fs.writeFile family of functions. Refs: nodejs#49886
This commit adds a 'flush' option to the fs.writeFile family of functions. Refs: nodejs#49886
This commit adds a 'flush' option to the fs.writeFile family of functions. Refs: #49886 PR-URL: #50009 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
This commit adds a 'flush' option to the createWriteStream() family of functions. Refs: nodejs#49886
This commit adds a 'flush' option to the createWriteStream() family of functions. Refs: nodejs#49886
This commit adds documentation and tests for the 'flush' option of the fs.appendFile family of functions. Technically, support was indirectly added in nodejs#50009, but this makes it more official. Refs: nodejs#49886 Refs: nodejs#50009
This commit adds documentation and tests for the 'flush' option of the fs.appendFile family of functions. Technically, support was indirectly added in nodejs#50009, but this makes it more official. Refs: nodejs#49886 Refs: nodejs#50009
This commit adds a 'flush' option to the createWriteStream() family of functions. Refs: #49886 PR-URL: #50093 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
This commit adds documentation and tests for the 'flush' option of the fs.appendFile family of functions. Technically, support was indirectly added in #50009, but this makes it more official. Refs: #49886 Refs: #50009 PR-URL: #50095 Reviewed-By: Matteo Collina <[email protected]>
This commit adds documentation and tests for the 'flush' option of the fs.appendFile family of functions. Technically, support was indirectly added in #50009, but this makes it more official. Refs: #49886 Refs: #50009 PR-URL: #50095 Reviewed-By: Matteo Collina <[email protected]>
I came here because I think I'm having issues with a fs.WriteStream and syncing before closing, but it does seem that (I'm partly posting this to check my own assumptions here, 🙏 ) |
Could you better articulate your question? |
Sorry, I didn't realize that the new option in node 21 was a result of this thread. There's no remaining question, now. |
This commit adds a 'flush' option to the fs.writeFile family of functions. Refs: nodejs#49886 PR-URL: nodejs#50009 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
This commit adds a 'flush' option to the createWriteStream() family of functions. Refs: nodejs#49886 PR-URL: nodejs#50093 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
This commit adds documentation and tests for the 'flush' option of the fs.appendFile family of functions. Technically, support was indirectly added in nodejs#50009, but this makes it more official. Refs: nodejs#49886 Refs: nodejs#50009 PR-URL: nodejs#50095 Reviewed-By: Matteo Collina <[email protected]>
This commit adds a 'flush' option to the fs.writeFile family of functions. Refs: #49886 PR-URL: #50009 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
This commit adds a 'flush' option to the createWriteStream() family of functions. Refs: #49886 PR-URL: #50093 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
This commit adds documentation and tests for the 'flush' option of the fs.appendFile family of functions. Technically, support was indirectly added in #50009, but this makes it more official. Refs: #49886 Refs: #50009 PR-URL: #50095 Reviewed-By: Matteo Collina <[email protected]>
This commit adds a 'flush' option to the fs.writeFile family of functions. Refs: nodejs#49886 PR-URL: nodejs#50009 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
This commit adds a 'flush' option to the createWriteStream() family of functions. Refs: nodejs#49886 PR-URL: nodejs#50093 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
What is the problem this feature will solve?
I believe it is possible that Node can close a file and then try to interact with the same file before all of the data has been written to disk. According to the docs for
close(2)
this can be fixed by callingfsync()
.What is the feature you are proposing to solve the problem?
Add an option to the appropriate
fs
functions (close()
,writeFile()
, etc.) to callfsync()
automatically.What alternatives have you considered?
Flushing the data "by hand."
The text was updated successfully, but these errors were encountered: