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

Change behaviour of Storage.Move to overwrite existing by default #5984

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

peppy
Copy link
Member

@peppy peppy commented Aug 24, 2023

Coming from https://github.com/ppy/osu/actions/runs/5948760882/job/16133189924, the only way I can see this happening is if the underlying File.Move logic is less atomic than we expect it to be.

In the process of looking into this, I noticed there's an overwrite flag available for File.Move which tends to prefer a rename operation internally on unix, rather than link.

On windows (the failcase in question) it likely won't help at the end of the day.

Anyway, personally I think having it overwrite by default is what we prefer from our API. If that isn't agreed on then closing this without further consideration is fine.

Coming from https://github.com/ppy/osu/actions/runs/5948760882/job/16133189924,
the only way I can see this happening is if the underlying `File.Move`
logic is less atomic than we expect it to be.

In the process of looking into this, I noticed there's an `overwrite`
flag available for `File.Move` which tends to prefer a `rename`
operation internally on unix, rather than `link`.

On windows (the failcase in question) it likely won't help at the end of
the day.

Anyway, personally I think having it overwrite by default is what we
prefer from our API. If that isn't agreed on then closing this without
further consideration is fine.
@smoogipoo
Copy link
Contributor

I weakly agree with this. The other option is to do as .NET does and add an overload.

@smoogipoo smoogipoo requested a review from bdach August 24, 2023 08:39
Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

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

No issue from me. Up to you if you wanna entertain making that a flag and what the default should be if so, but I think it's basically fine as is.

@peppy peppy merged commit 3e38ea9 into ppy:master Aug 24, 2023
16 of 20 checks passed
@peppy peppy deleted the storage-move-overwrite branch September 14, 2023 09:54
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