From b9c9efcf507a8b58c05e6439d6efd68f0c6b6f88 Mon Sep 17 00:00:00 2001 From: chrislusf Date: Sat, 6 Dec 2025 12:40:48 -0800 Subject: fix: remove redundant unmount call in Unmount function The weedMountProcess.wait() function already handles unmounting when the process terminates. Removing the explicit unmount call in Unmount() centralizes the unmount logic and avoids potential race conditions. --- pkg/mountmanager/manager.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'pkg') diff --git a/pkg/mountmanager/manager.go b/pkg/mountmanager/manager.go index 493333a..7d6a908 100644 --- a/pkg/mountmanager/manager.go +++ b/pkg/mountmanager/manager.go @@ -99,12 +99,9 @@ func (m *Manager) Unmount(req *UnmountRequest) (*UnmountResponse, error) { return &UnmountResponse{}, nil } - if ok, err := kubeMounter.IsMountPoint(entry.targetPath); ok || mount.IsCorruptedMnt(err) { - if err = kubeMounter.Unmount(entry.targetPath); err != nil { - return nil, err - } - } - + // Note: We don't explicitly unmount here because weedMountProcess.wait() + // handles the unmount when the process terminates (either gracefully or forcefully). + // This centralizes unmount logic and avoids potential race conditions. if err := entry.process.stop(); err != nil { return nil, err } -- cgit v1.2.3