-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Call File::sync_all when finalizing encoding #123880
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
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Call File::sync_all when finalizing encoding rust-lang#123352 (comment) r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (cbad6f1): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 677.972s -> 678.686s (0.11%) |
I'm curious about the motivation. |
In the linked issue, a user repeatedly rebooted a VM, presumably causing the filesystem to lose non- In general the safe-save pattern (i.e. write a new file, then move it over an existing file) is not safe in the presence of unexpected shutdown without an However, IMO, trying to keep build products consistent in the face of unclean shutdowns is a losing game. Lots of other files get generated during a build, by many different tools (linkers? build scripts?), and those generally don't call |
In fact my aim with #82047 was to ensure that metadata writes are as non-durable as they can be. This is very useful for repeated rebuilds or short-lived things like UI tests and doctests where the intermediate files are thrown away or replaced soon after they have been created. By avoiding all syncing they only stay in the page-cache and no IO-waits are incurred.
Agreed. Plus there are other sources of corruption, especially on non-checksumming filesystems. |
I agree that a better approach is to detect the problem. The trouble is actually detecting the problem in a way that doesn't incorrectly detect a compiler issue. Until quite recently, reproducible compiler bugs produced a lot of corrupt output files, and nobody else debugged that. I don't think that accidentally papering over a family of compiler bugs in an attempt to be resilient to misbehaving filesystems or operating systems is a good outcome. So I'm going to close this and see what I can come up with. Ideally we'd have some sort of telemetry, but maybe a future diagnostic can ask people to comment on an issue. |
#123352 (comment)
r? @ghost