Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V2] fix: Fix for intermittent failure for NodeStageVolume request #1395

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions pkg/azuredisk/nodeserver_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,14 @@ func (d *DriverV2) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolume
source, err := d.nodeProvisioner.GetDevicePathWithLUN(ctx, int(lun))
if err == nil {
d.markRecoveryCompleteIfInProcess(diskURI)
} else if !waitedForAttach && d.enableListVolumes {
// recovery has a dependency on listVolumes call. Only proceed with recovery if listVolumes is enabled.
// if device path could not be found, start mount recovery only if the function's context was not used up waiting for AzVolumeAttachment CRI attachment to complete
err = status.Errorf(codes.Internal, "failed to find disk on lun %v. %v", lun, err)
go d.recoverMount(diskURI)
} else {
if !waitedForAttach && d.enableListVolumes {
// recovery has a dependency on listVolumes call. Only proceed with recovery if listVolumes is enabled.
// if device path could not be found, start mount recovery only if the function's context was not used up waiting for AzVolumeAttachment CRI attachment to complete
err = status.Errorf(codes.Internal, "failed to find disk on lun %v. %v", lun, err)
go d.recoverMount(diskURI)
}

return nil, err
}

Expand Down