-
Notifications
You must be signed in to change notification settings - Fork 106
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
Goroutine race breaks guarantees on write -> flush barrier #3
Comments
So what to do about this? Some options:
|
This can be made very easy to reproduce by sticking a The same is not true of |
Closing the loop: I think perhaps the reason that we wait for write(2) is because we don't respond to |
Current favored solution:
|
This is blocked by #4; we want tests that we can run many times to confirm we've fixed the issue. |
…ucts. This aovids the fundamental race in #3.
All done with 336525b. |
UPDATE, 2015-04-02: Make sure to see also issue #8. Much of this is incorrectly diagnosed, due to a kernel bug.
If I run the test
FlushFSTest.Mmap_MunmapBeforeClose
1,000 times waiting for the first error, like so:it almost always fails with something like the following:
Running with
--fuse.debug
shows this is because the second write request (from the modification to the mapped memory) is received after the flush for the close(2), which happens before the modification in test sequence.This is puzzling, given the code walk documented on
WriteFile
which appears to prove that fuse writes out all dirty pages before sending a flush request:The comments there talk about pending
writepages
requests, but don't use the term "dirty". The commit that introduced this behavior, torvalds/linux@fe38d7d is more clear it talks directly about "dirty pages".I modified the way requests are logged by
server.go
, and I believe the issue here is simply that the goroutines spawned byserver.Serve
are racing. That is, fuse is sending "write, write, flush", but we are processing them as "write, flush, write" because fuse sends write requests but doesn't wait for them.The text was updated successfully, but these errors were encountered: