-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Introduce concept of enforced atomic operations (fix #193151) #193228
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
…to FileUserDataProvider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except one code style issue.
I leave it up to @sandy081 to comment on the impact of this change. I think the idea of this provider was to explicitly enforce atomic writes on the level of the file system provider for all user data files (except backups). With your change, we now rely on the file service to use writeFile for this to happen. But writeFile is used only in specific conditions, for example when the file is small (3 * 64kb I believe) or when a file is changed not through an editor that has a ITextSnapshot but programmatically where the entire buffer is passed in (which I believe is most often the case with user data).
Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
@bpasero Is it also true if programmatic save goes through
|
|
@sandy081 no. But I think a better solution is to stop overriding the file system provider and do what I had suggested in #193151 (comment) |
|
In this case, I would not suggest this change. It is important to have atomic write for user data like settings and extensions. |
|
This is ready for review. |
sandy081
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good change. I liked it.
sandy081
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good change. I liked it.
The only two file system providers being passed to
FileUserDataProvideris either the disk one or the in memory one. The former already supportsIFileSystemProviderWithOpenReadWriteCloseCapabilitythus in this PR we added the capability to the in memory file system provider