aboutsummaryrefslogtreecommitdiff
path: root/pkg/driver/nodeserver.go
diff options
context:
space:
mode:
authorchrislusf <chris.lu@gmail.com>2025-12-03 20:00:39 -0800
committerChris Lu <chrislusf@users.noreply.github.com>2025-12-03 20:52:27 -0800
commitfe60f2bf160c1191eb81765af2b2fc32a6d311b5 (patch)
tree7b66a9faba9fdc14b2243d4e59b18000938ee104 /pkg/driver/nodeserver.go
parent639573bdc0108da9c4d6fce7ffcb897ea1b71e14 (diff)
downloadseaweedfs-csi-driver-fe60f2bf160c1191eb81765af2b2fc32a6d311b5.tar.xz
seaweedfs-csi-driver-fe60f2bf160c1191eb81765af2b2fc32a6d311b5.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.
Diffstat (limited to 'pkg/driver/nodeserver.go')
-rw-r--r--pkg/driver/nodeserver.go2
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)
}