Skip to content

Commit

Permalink
Merge pull request #1395 from mukhoakash/mukhoakash/fix_if_condition
Browse files Browse the repository at this point in the history
[V2] fix: Fix for intermittent failure for NodeStageVolume request
  • Loading branch information
edreed committed Jun 25, 2022
2 parents 0201d54 + 8ae2cee commit 67b22f6
Showing 1 changed file with 8 additions and 5 deletions.
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

0 comments on commit 67b22f6

Please sign in to comment.