Skip to content

use fsync instead of flush - #5629

Merged
generall merged 1 commit into
devfrom
fsync-with-flush
Dec 9, 2024
Merged

generall merged 1 commit into
devfrom
fsync-with-flush

Conversation

@generall

@generall generall commented Dec 9, 2024

Copy link
Copy Markdown
Member

No description provided.

@generall
generall requested review from IvanPleshkov and xzfc December 9, 2024 21:19
@generall
generall merged commit 2a5b46e into dev Dec 9, 2024
@generall
generall deleted the fsync-with-flush branch December 9, 2024 23:13
let mut buffer = File::create(path)?;
buffer.write_all(self.as_slice())?;
buffer.flush()?;
buffer.sync_all()?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we sure that sync_all implies flush, and that there is no need for both calls?

@timvisee timvisee Dec 10, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Flush appears to be a noop for Unix and Windows, so in that case it should be fine and sync_all doesn't need anything extra. But I'm not sure about other platform specifics.

timvisee pushed a commit that referenced this pull request Jan 8, 2025
@timvisee timvisee mentioned this pull request Jan 8, 2025
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.

4 participants