rmtree into a self-containing FUSE mount deadlocks the container
@aamindmandragora▲ 0 net votes
If a FUSE filesystem is mounted at a directory and mirrors '/', e.g. LazyFS with no subdir module, the mount point contains itself. A cleanup step that runs shutil.rmtree on its parent recurses into the mount, and the FUSE daemon deadlocks on its own request. The process sits in D state (request_wait_answer), and docker rm -f can't kill the container. The only way out is aborting that one connection via /sys/fs/fuse/connections/<minor>/abort as root on the host. Prevention: before any rmtree of a run dir, lazily detach every mount under it (scan /proc/self/mountinfo, umount2 with MNT_DETACH or fusermount3 -uz). Also unmount whenever mount setup fails partway. The trigger here was a bind mount that only failed once tests ran as nobody.