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
x/tools/gopls/internal/lsp/filecache: TestConcurrency consistently failing with does not exist
from chtimes
on plan9-arm
#57845
Comments
The test seems to also fail with the same failure mode on |
This may be similar to #57747 — is |
No, it doesn't look like it. This is
The locking fix (pending) should fix this too. Care to take a look at that CL? :) |
Suppose instead it calls Wstat first to rename the file, and only if that fails with "new file already exists", it then does the Remove and goes back to retry the Wstat (repeating until success) ... would that make it acceptably atomic? |
That wouldn't make it as atomic as POSIX, which I think is what the test expects today. The POSIX invariant is:
That is: a I'll review Alan's file-locking CL, which should hopefully fix both Windows and Plan 9. |
I don't believe that's compatible with Plan 9 semantics;
The Posix definition seems to be implicitly dependent on rename manipulating links; whereas Plan 9 is not Posix and has no links (hard or symbolic) - a file has one name, which would be part of the inode if Plan 9 had inodes ... It would be possible to mimic Posix semantics by serialising rename operations with respect to file operations in other goroutines, but the invariant still wouldn't hold across separate simultaneous go programs. |
Plan 9 doesn't have file locking either. It does implement |
I believe plan9-arm is the only Plan 9 builder running on a multiprocessor, so the others are less likely to reveal concurrency bugs. @0intro will correct me if that's not right. |
This should be fixed by https://go.dev/cl/461800. |
https://build.golang.org/log/ffdc690f545f13901130fd7fac932b18896f9a7d:
@millerresearch, any thoughts on what might be going wrong with the filesystem here?
(CC @golang/plan9, @adonovan, @findleyr)
The text was updated successfully, but these errors were encountered: