sapling/eden/fs
Adam Simpkins 6cc56a6f81 fix hangs in FuseChannel shutdown
Summary:
The FuseChannel unit tests would sometimes hang because a worker thread would
still be stuck in a blocking read() call.

The issue appears to be that the kernel would often automatically restart the
interrupted read(), so the worker would never wake up.  This switches the code
from using SIGPIPE to wake up, and instead uses SIGUSR2, and installs a handler
for SIGUSR2 with the SA_RESTART flag unset.

It's possible that this was an issue only for the unit tests, where the FUSE
device is a socket.  I'm not sure if the kernel would automatically restart
read operations on a real FUSE device.

There are still theoretically some race conditions here, since
`requestSessionExit()` could be called right after a worker thread checks
`(runState_` and before it enters the blocking `read()` call.  Fixing that
would likely require switching to something like `folly::EventBase` or manually
using epoll.  Fortunately I haven't seen that be an issue in practice so far.

Reviewed By: chadaustin, wez

Differential Revision: D7282002

fbshipit-source-id: 99d29de13a7858dd25f258fdc94d8f8c71ee84d9
2018-03-15 13:48:45 -07:00
..
config Remove TARGETS files 2018-02-20 19:57:45 -08:00
fuse fix hangs in FuseChannel shutdown 2018-03-15 13:48:45 -07:00
inodes update FuseChannel to signal the session complete future immediately 2018-03-15 13:48:45 -07:00
journal Remove TARGETS files 2018-02-20 19:57:45 -08:00
model Remove TARGETS files 2018-02-20 19:57:45 -08:00
rocksdb Remove TARGETS files 2018-02-20 19:57:45 -08:00
service don't swallow sudo's stdout and stderr in eden daemon 2018-03-14 12:46:19 -07:00
sqlite add SqliteLocalStore 2018-02-08 20:06:55 -08:00
store Remove TARGETS files 2018-02-20 19:57:45 -08:00
takeover Remove TARGETS files 2018-02-20 19:57:45 -08:00
testharness restructure FuseChannel initialization and synchronization 2018-03-13 13:29:03 -07:00
utils fix incorrect deallocation size in UnixSocket::SendQueueDestructor 2018-03-08 17:45:57 -08:00