From fe60f2bf160c1191eb81765af2b2fc32a6d311b5 Mon Sep 17 00:00:00 2001 From: chrislusf Date: Wed, 3 Dec 2025 20:00:39 -0800 Subject: 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. --- pkg/driver/nodeserver.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkg') 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) } -- cgit v1.2.3