graysky2 / anything-sync-daemon

Symlinks and syncs user specified dirs to RAM thus reducing HDD/SDD calls and speeding-up the system.
https://wiki.archlinux.org/index.php/Anything-sync-daemon
MIT License
345 stars 45 forks source link

Stopping asd kills fuse mounts (error: Transport endpoint is not connected) #86

Open rhyc opened 11 months ago

rhyc commented 11 months ago

Hi! I have encountered unexpected behavior from anything-sync-daemon.

My setup:

Anything-Sync-Daemon v6.0.0 Host: Ubuntu 20.04 VM Guest: Debian 12 Vmware Workstation 16

The host shares multiple directories to guest via fuse.vmhgfs-fuse. ASD runs inside guest, and its WHATTOSYNC is a sub-directory of a shared directory. OVERLAYFS is not used.

Everything runs fine until I stop ASD with sudo systemctl stop asd.service

Then all shared directories become dead in guest. I get error Transport endpoint is not connected trying to access them.

Expected behavior: After I stop ASD, all shared directories continue to function in guest.

As far as I can tell, the offending code is in do_unsync():

umount -R -f -l "$DIR"
umount -R -f -l "$BACKUP"

The forced umount kills fuse service. After I remove -f from umount, ASD seems to behave correctly in my setup.

I found a thread discussing this behavior of umount -f:

fuse filesystems get disconnected on container exit

Edit: According to Thread: [fuse-devel] bind mount and ENODEV and Aborting a filesystem connection, this is the expected and documented behavior of umount -f