Skip to content

Conversation

@andrewrk
Copy link
Member

This fixes .INVAL => unreachable being triggered by the cache system on macOS when multiple processes race to create the same compilation. The problem is that when two processes race to create a file, it sometimes returns ENOENT even though that error code is nonsensical for this situation.

Commit 2b09299 purportedly solved this, but it did not open the file with write permissions, leading to the EINVAL panic later on. This commit remedies the situation by introducing a loop and simply retrying when the ENOENT occurs.

This fixes `.INVAL => unreachable` being triggered by the cache system
on macOS when multiple processes race to create the same compilation.
The problem is that when two processes race to create a file, it
sometimes returns ENOENT even though that error code is nonsensical for
this situation.

Commit 2b09299 purportedly solved this,
but it did not open the file with write permissions, leading to the
EINVAL panic later on. This commit remedies the situation by introducing
a loop and simply retrying when the ENOENT occurs.
@andrewrk andrewrk enabled auto-merge (rebase) April 18, 2023 20:16
@andrewrk andrewrk merged commit 3428653 into master Apr 19, 2023
@andrewrk andrewrk deleted the fix-macos-cache-race branch April 19, 2023 00:53
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.

1 participant