Skip to content

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