Fix filesystem::directory_entry::refresh on Win11 24H2#5077
Merged
StephanTLavavej merged 2 commits intomicrosoft:mainfrom Nov 14, 2024
Merged
Fix filesystem::directory_entry::refresh on Win11 24H2#5077StephanTLavavej merged 2 commits intomicrosoft:mainfrom
filesystem::directory_entry::refresh on Win11 24H2#5077StephanTLavavej merged 2 commits intomicrosoft:mainfrom
Conversation
CaseyCarter
approved these changes
Nov 11, 2024
Member
Author
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After upgrading to Win11 24H2, I observed a very sporadic failure in
P0218R1_filesystem. (#4844 was also a behavioral change in 24H2, but that one was consistent.) Eventually I was able to reproduce this with focused testing:Click to expand reduced test case:
According to System Error Codes (0-499), this is:
Like in #4844, we need to teach
__std_is_file_not_foundto recognize this error code.(I don't know, and don't really care, what the root cause is. In my reduced test case, I randomly switch between random hexits and "woof" in the nonexistent server name, and only the "woof" case seems to fail. I suspect that this is somehow related to filesystem caching, where repeatedly querying for a network name's existence can sometimes return this
ERROR_NETNAME_DELETEDerror code.)Finally, #4844 enhanced
P0218R1_filesystem, which was very helpful here, but not quite enough:In this case, I really needed to know the numeric error code, not just the message, so I'm further enhancing the test coverage to print the
filesystem_error's error code value and category (expected to be the system category). I verified that with this test change, but without the product code fix, the sporadic failure prints: