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 race condition in FileStorageKey #3479

Merged
merged 6 commits into from
Nov 12, 2024
Merged

Conversation

mbrandonw
Copy link
Member

@mbrandonw mbrandonw commented Nov 4, 2024

This fixes a race condition between mutating @Shared(.fileStorage) directly and the file system notifying it of changes on disk.

@mbrandonw mbrandonw changed the title Failing test for multiple mutations to file storage. Fix race condition in FileStorageKey Nov 12, 2024
Comment on lines 252 to +254
try fileStorage.save(Data(), .fileURL)
scheduler.run()
expectNoDifference(users, [])
expectNoDifference(users, [.blob])
Copy link
Member Author

Choose a reason for hiding this comment

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

Changes made to the file on disk will be ignored if there is an enqueued state change waiting to be saved.

@mbrandonw mbrandonw merged commit 2170719 into main Nov 12, 2024
13 checks passed
@mbrandonw mbrandonw deleted the file-storage-failing-test branch November 12, 2024 23:38
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.

2 participants