tvl-depot/tvix/castore
Florian Klink 7e42b4f314 fix(tvix/store/bin): fix shutdown behaviour for FUSE
Both umounts happening from another process, as well as tvix-store
itself calling umount() on FuseDaemon will cause the FUSE worker threads
to terminate.

So far there was no nice way to wait on these threads to be terminated
from multiple places, causing the `tvix-store mount` command to only be
terminated if interrupted via ctrl-c, not via an external umount.

Update FuseDaemon to use a ThreadPool, which gives us a join primitive
over all threads, that can also be called from multiple places.

Await on a join() from there to end the program, not the ctrl-c signal
handler as it was before.

Using FuseDaemon from multiple tasks requires Arc<>-ing both the
ThreadPool as well as the inner FuseSession (which also needs to be
inside a Mutex if we want to unmount), but now we can clone FuseDaemon
around and use it in two places. We could probably also have used an
Option and drop the FuseSession after the first umount, but this looks
cleaner.

Change-Id: Id635ef59b560c111db52ad0b3ca3d12bc7ae28ca
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11825
Reviewed-by: Brian Olsen <me@griff.name>
Tested-by: BuildkiteCI
2024-06-16 12:02:11 +00:00
..
protos docs(tvix/castore/directorysvc): K/V is not necessarily flat 2024-02-20 09:17:38 +00:00
src fix(tvix/store/bin): fix shutdown behaviour for FUSE 2024-06-16 12:02:11 +00:00
build.rs feat(tvix/castore): derive Eq and Hash automatically 2024-03-20 21:19:02 +00:00
Cargo.toml fix(tvix/store/bin): fix shutdown behaviour for FUSE 2024-06-16 12:02:11 +00:00
default.nix feat(tvix): add CI targets for checking crate features powerset 2024-06-03 16:35:51 +00:00