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

fix(bundle-source): Accommodate Windows lack of atomic rename #1957

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

kriskowal
Copy link
Member

Fixes #1955

Windows rename is not atomic and fails if the target exists. Our CI revealed this to us because it cached a bundle.

@kriskowal kriskowal requested a review from mhofman January 10, 2024 23:05
@kriskowal kriskowal force-pushed the kriskowal-1955 branch 3 times, most recently from 8182d54 to 4d913ff Compare January 10, 2024 23:42
Copy link
Contributor

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

I'm confused. Why not get the stats after the rename? would that not alleviate the risk of race?

@kriskowal
Copy link
Member Author

I'm confused. Why not get the stats after the rename? would that not alleviate the risk of race?

The race occurs if there are concurrent reads and writes for the same cache entry. The reader can encounter a partial bundle. But, I won’t pretend that I’ve thought this through completely.

@kriskowal kriskowal merged commit 6bbcc75 into master Jan 11, 2024
@kriskowal kriskowal deleted the kriskowal-1955 branch January 11, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows broke atomic rename
2 participants