diff options
| author | chrislusf <chris.lu@gmail.com> | 2025-12-03 20:00:39 -0800 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2025-12-03 20:00:39 -0800 |
| commit | 64082cc28443d9489c10fa8cee47d023892ece43 (patch) | |
| tree | fd012fcf84c9fe0d7c1786faed1a8ebd81229222 | |
| parent | 7ae3b9274881a40dd209dff1b3c7bb55ed8f3377 (diff) | |
| download | seaweedfs-csi-driver-64082cc28443d9489c10fa8cee47d023892ece43.tar.xz seaweedfs-csi-driver-64082cc28443d9489c10fa8cee47d023892ece43.zip | |
fix: cleanup volume mutex on self-healing failure in NodePublishVolume
Address gemini-code-assist review - when cleanup or re-staging fails
during self-healing in NodePublishVolume, remove the volume mutex to
avoid leaving stale entries. This maintains consistency with
NodeStageVolume's error handling behavior.
| -rw-r--r-- | pkg/driver/nodeserver.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/driver/nodeserver.go b/pkg/driver/nodeserver.go index e65038e..21e68bf 100644 --- a/pkg/driver/nodeserver.go +++ b/pkg/driver/nodeserver.go @@ -150,6 +150,7 @@ func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis // Clean up stale staging path if it exists if err := cleanupStaleStagingPath(stagingTargetPath); err != nil { + ns.removeVolumeMutex(volumeID) return nil, status.Errorf(codes.Internal, "failed to cleanup stale staging path %s: %v", stagingTargetPath, err) } @@ -159,6 +160,7 @@ func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis newVolume, err := ns.stageNewVolume(volumeID, stagingTargetPath, volContext, readOnly) if err != nil { + ns.removeVolumeMutex(volumeID) return nil, status.Errorf(codes.Internal, "failed to re-stage volume: %v", err) } |
