aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
author泽淼 周 <zhouzemiao@ihuman.com>2025-09-28 17:05:56 +0800
committerChris Lu <chrislusf@users.noreply.github.com>2025-12-06 18:53:22 -0800
commite0e2bdd678fc3304d54ca0f391754db73554d7f3 (patch)
tree633e5df0e00bd5cb692c291bae76183f0919bb5e /pkg
parentf76db0631a559162172226ad47057301b43ede5b (diff)
downloadseaweedfs-csi-driver-e0e2bdd678fc3304d54ca0f391754db73554d7f3.tar.xz
seaweedfs-csi-driver-e0e2bdd678fc3304d54ca0f391754db73554d7f3.zip
fix: Zombie process
Diffstat (limited to 'pkg')
-rw-r--r--pkg/mountmanager/manager.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg/mountmanager/manager.go b/pkg/mountmanager/manager.go
index 26dda18..420300e 100644
--- a/pkg/mountmanager/manager.go
+++ b/pkg/mountmanager/manager.go
@@ -97,6 +97,12 @@ func (m *Manager) Unmount(req *UnmountRequest) (*UnmountResponse, error) {
return &UnmountResponse{}, nil
}
+ if ok, err := mountutil.IsMountPoint(entry.targetPath); ok || mount.IsCorruptedMnt(err) {
+ if err = mountutil.Unmount(entry.targetPath); err != nil {
+ return &UnmountResponse{}, err
+ }
+ }
+
defer os.RemoveAll(entry.cacheDir)
if err := entry.process.stop(); err != nil {
@@ -266,10 +272,6 @@ func (p *weedMountProcess) wait() {
}
func (p *weedMountProcess) stop() error {
- if p.cmd.Process == nil {
- return nil
- }
-
if err := p.cmd.Process.Signal(syscall.SIGTERM); err != nil && err != os.ErrProcessDone {
glog.Warningf("sending SIGTERM to weed mount failed: %v", err)
}