diff options
| author | 泽淼 周 <zhouzemiao@ihuman.com> | 2025-09-28 17:05:56 +0800 |
|---|---|---|
| committer | Chris Lu <chrislusf@users.noreply.github.com> | 2025-12-06 18:53:22 -0800 |
| commit | e0e2bdd678fc3304d54ca0f391754db73554d7f3 (patch) | |
| tree | 633e5df0e00bd5cb692c291bae76183f0919bb5e /pkg/mountmanager/manager.go | |
| parent | f76db0631a559162172226ad47057301b43ede5b (diff) | |
| download | seaweedfs-csi-driver-e0e2bdd678fc3304d54ca0f391754db73554d7f3.tar.xz seaweedfs-csi-driver-e0e2bdd678fc3304d54ca0f391754db73554d7f3.zip | |
fix: Zombie process
Diffstat (limited to 'pkg/mountmanager/manager.go')
| -rw-r--r-- | pkg/mountmanager/manager.go | 10 |
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) } |
