Skip to content
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

Make Windows' safe save more resilient #81001

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

RandomShaper
Copy link
Member

I was investigating failed last steps of safe save. After some tries to find out the specific issue with procmon and other tools, I could not find the exact reason for the many ERROR_SHARING_VIOLATION in ReplaceFileW.

However, while searching for info on the matter, I found old and new implementations of file rename in LLVM:

The takeaway for me is that those implementations try way harder, like up to hundreds of times with very little rest between.

This PR does precisely that (try a lot) as well as remove the check for file existence, attempting right away the replace (also in the spirit of LLVM's implementations).

With this PR, all the previously failing cases work.

@akien-mga akien-mga merged commit 56b13b6 into godotengine:master Aug 30, 2023
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants