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

Add locking to avoid race conditions in cache #118

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JulianGCalderon
Copy link
Contributor

@JulianGCalderon JulianGCalderon commented Jan 9, 2025

Currently, if two replay instances execute the same block at the same time, race conditions can appear when writing to the cache, corrupting it's state.

This PR fixes it by using file locks to ensure that only one process modifies the cache at a time.

I added fs2 as a dependency, as the file lock API of the standard fs crate is nightly only.

@JulianGCalderon JulianGCalderon changed the base branch from cache-rpc to main January 10, 2025 15:32
@JulianGCalderon JulianGCalderon marked this pull request as ready for review January 10, 2025 18:25
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