From 7387e6b46784771f95b8a6fbc5c2b49fcfe54acf Mon Sep 17 00:00:00 2001 From: Viktor Kuzmin Date: Mon, 26 Sep 2022 21:24:10 +0300 Subject: [PATCH] Make sure we'll have no stale mount after process kill --- pkg/driver/mounter.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/driver/mounter.go b/pkg/driver/mounter.go index 8a48967..909e6ec 100644 --- a/pkg/driver/mounter.go +++ b/pkg/driver/mounter.go @@ -77,6 +77,10 @@ func fuseMount(path string, command string, args []string) (Unmounter, error) { glog.Infof("weed mount exit, pid: %d, path: %v", cmd.Process.Pid, path) } + // make sure we'll have no stale mounts + time.Sleep(time.Millisecond * 100) + _ = mount.New("").Unmount(path) + close(fu.finished) }()