• Kirill Smelkov's avatar
    wcfs: Server.stop: Make sure to remove mount entry even if we had to use FUSE abort · 5f684a49
    Kirill Smelkov authored
    Server.stop currently tries to unmount, and if that fails invokes FUSE
    abort and kills wcfs.go . However it does not call unmount the second
    time after such abort, and this way the filesystem remains mounted (in
    ENOTCONN state) and rmdir(mountpoint) fails.
    
    -> Fix it by calling unmount the second time if we had to abort FUSE
    connection. In that second try use lazy unmounting, because regular
    unmount can still fail with "Device or resource busy" since there
    could be still client file descriptors left pointing to the mounted
    filesystem. With lazy mode unmounting + followup rmdir, hopefully,
    always succeeds.
    
    Here is example test run where one test timed out, FUSE connection was
    aborted, but neither the filesystem was unmounted, nor mountpoint
    directory was deleted, which led to all followup tests failing in setup
    assert that testmountpoint does not exist:
    
    https://nexedijs.erp5.net/#/test_result_module/20211112-1ACEA62D/22
    
    This patch should fix those followup failures + fix another leakage of
    WCFS mounts in real services.
    5f684a49
__init__.py 24.5 KB