diff options
Diffstat (limited to 'pkg/mountmanager/manager.go')
| -rw-r--r-- | pkg/mountmanager/manager.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/mountmanager/manager.go b/pkg/mountmanager/manager.go index e4e4329..1bdeb3e 100644 --- a/pkg/mountmanager/manager.go +++ b/pkg/mountmanager/manager.go @@ -102,12 +102,15 @@ func (m *Manager) Unmount(req *UnmountRequest) (*UnmountResponse, error) { } } - defer os.RemoveAll(entry.cacheDir) - if err := entry.process.stop(); err != nil { return nil, err } + // Remove cache dir only after process has been successfully stopped + if err := os.RemoveAll(entry.cacheDir); err != nil { + glog.Warningf("failed to remove cache dir %s for volume %s: %v", entry.cacheDir, req.VolumeID, err) + } + glog.Infof("stopped weed mount process for volume %s at %s", req.VolumeID, entry.targetPath) return &UnmountResponse{}, nil } |
