-
Notifications
You must be signed in to change notification settings - Fork 266
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
Process hangs when writing to mount point served by the same process #264
Comments
You're not missing anything; that just simply won't work, due to how Go runtime is doing things. If there's a way around the epoll deadlock, I'm not aware of it. Go assumes certain syscalls don't block, FUSE makes them block, and thus Go doesn't let another goroutine service the FUSE request to let the first one complete. This has already been "fixed" as much as we can; by basically just not doing that. See the following commit: commit 3f5ad90
(Repeat for Github linking: #183 ) |
Thanks for the explanation and the pointer to the framework! |
Fixes #78 The fuse tests were sporadically failing often leaving <defunct> processes which were loading process queue. I observed load of 30 for several our until reboot, though there we no negative effects. After investigation, we found that this is due to `go` (v1.9 and up) ways of handling poll requests. Here are the outcomes: The routines which manage fuse layer and OS dependent code (os.Open, and similar) MUST BE SEPARATE OS PROCESSES. Note: not different `go` routines but processes! See bazil/fuse#264 (comment) This separation happens automatically during normal brig operations, but TESTING FUSE LAYER IN GO IS VERY TRICKY. See brig relevant discussion at #77 (comment) However, this problem is general for any go program from version 1.9, as can be seen in references to the issue. bazil/fuse offers "bazil.org/fuse/fs/fstestutil/spawntest" infrastructure which helps run tests in different communicating via socket processes. This commit rewrites fuse test to use methods from `spawntest`.
I was writing unit tests for my filesystem implementation when I noticed that the test process sometimes hanged. It seems like everything works fine when my binary serves the mount point and other processes access it but when the same process is both serving and using the mount point something gets stuck. Example code:
Running
FORK=1 go run main.go
fires up the mount point and accesses it from a different process. This works fine:However running
FORK=0 go run main.go
hangs most of the time. In output below I sendSIGABRT
to the hangedmain
process:Am I missing anything? Happy to help debugging this if I get some pointers. Thanks.
The text was updated successfully, but these errors were encountered: