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

Module: rewrite zir caching logic #14821

Merged
merged 1 commit into from
Mar 8, 2023
Merged

Conversation

jacobly0
Copy link
Member

@jacobly0 jacobly0 commented Mar 6, 2023

Multiple processes can sit waiting for the exclusive lock at the same time, so we want to recheck whether it needs to be updated whenever we get an exclusive lock.

This also fixes a race condition between one process truncating the cache file and another process reading it without atomic locking.

This could use some extra testing/review as I haven't done much testing yet.

Multiple processes can sit waiting for the exclusive lock at the same
time, so we want to recheck whether it needs to be updated whenever
we get an exclusive lock.

This also fixes a race condition between one process truncating the
cache file and another process reading it without atomic locking.
@andrewrk
Copy link
Member

andrewrk commented Mar 8, 2023

This patch solved the warning(module): unexpected EOF reading cached ZIR for <file> I was reliably seeing in #14647. Nice work!

Also, the logic looks good to me.

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