diff options
| author | 泽淼 周 <zhouzemiao@ihuman.com> | 2025-09-28 17:09:12 +0800 |
|---|---|---|
| committer | Chris Lu <chrislusf@users.noreply.github.com> | 2025-12-06 18:53:22 -0800 |
| commit | 8d10a3182ef56bea8a8cb10b086be93d408ee593 (patch) | |
| tree | 3dfe950074555627ca23f029d1a71b4bbe5ba9bf /pkg | |
| parent | e0e2bdd678fc3304d54ca0f391754db73554d7f3 (diff) | |
| download | seaweedfs-csi-driver-8d10a3182ef56bea8a8cb10b086be93d408ee593.tar.xz seaweedfs-csi-driver-8d10a3182ef56bea8a8cb10b086be93d408ee593.zip | |
feat: add log
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/mountmanager/manager.go | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/pkg/mountmanager/manager.go b/pkg/mountmanager/manager.go index 420300e..19662f3 100644 --- a/pkg/mountmanager/manager.go +++ b/pkg/mountmanager/manager.go @@ -58,7 +58,7 @@ func (m *Manager) Mount(req *MountRequest) (*MountResponse, error) { if entry := m.getMount(req.VolumeID); entry != nil { if entry.targetPath == req.TargetPath { - glog.V(1).Infof("volume %s already mounted at %s", req.VolumeID, req.TargetPath) + glog.Infof("volume %s already mounted at %s", req.VolumeID, req.TargetPath) return &MountResponse{LocalSocket: entry.localSocket}, nil } return nil, fmt.Errorf("volume %s already mounted at %s", req.VolumeID, entry.targetPath) @@ -73,8 +73,7 @@ func (m *Manager) Mount(req *MountRequest) (*MountResponse, error) { m.mounts[req.VolumeID] = entry m.mu.Unlock() - go m.watchMount(req.VolumeID, entry) - + glog.Infof("started weed mount process for volume %s at %s", req.VolumeID, req.TargetPath) return &MountResponse{LocalSocket: entry.localSocket}, nil } @@ -93,7 +92,7 @@ func (m *Manager) Unmount(req *UnmountRequest) (*UnmountResponse, error) { entry := m.removeMount(req.VolumeID) if entry == nil { - glog.V(1).Infof("volume %s not mounted", req.VolumeID) + glog.Infof("volume %s not mounted", req.VolumeID) return &UnmountResponse{}, nil } @@ -109,6 +108,7 @@ func (m *Manager) Unmount(req *UnmountRequest) (*UnmountResponse, error) { return nil, err } + glog.Infof("stopped weed mount process for volume %s at %s", req.VolumeID, entry.targetPath) return &UnmountResponse{}, nil } @@ -127,17 +127,6 @@ func (m *Manager) removeMount(volumeID string) *mountEntry { return entry } -func (m *Manager) watchMount(volumeID string, entry *mountEntry) { - <-entry.process.done - m.mu.Lock() - current, ok := m.mounts[volumeID] - if ok && current == entry { - delete(m.mounts, volumeID) - } - m.mu.Unlock() - os.RemoveAll(entry.cacheDir) -} - func (m *Manager) startMount(req *MountRequest) (*mountEntry, error) { targetPath := req.TargetPath if err := ensureTargetClean(targetPath); err != nil { |
