Skip to content

Commit

Permalink
Merge pull request #2469 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2461-to-release-1.29

[release-1.29] fix: checkDiskLun throttling issue
  • Loading branch information
andyzhangx authored Aug 17, 2024
2 parents 7eeece1 + 70ba7e7 commit 8788b24
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/azuredisk/azuredisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (d *Driver) isGetDiskThrottled() bool {
}

func (d *Driver) isCheckDiskLunThrottled() bool {
cache, err := d.throttlingCache.Get(consts.CheckDiskLunThrottlingKey, azcache.CacheReadTypeDefault)
cache, err := d.checkDiskLunThrottlingCache.Get(consts.CheckDiskLunThrottlingKey, azcache.CacheReadTypeDefault)
if err != nil {
klog.Warningf("throttlingCache(%s) return with error: %s", consts.CheckDiskLunThrottlingKey, err)
return false
Expand Down Expand Up @@ -507,7 +507,8 @@ func (d *DriverCore) getUsedLunsFromVolumeAttachments(ctx context.Context, nodeN
return nil, fmt.Errorf("kubeClient or kubeClient.StorageV1() or kubeClient.StorageV1().VolumeAttachments() is nil")
}

volumeAttachments, err := kubeClient.StorageV1().VolumeAttachments().List(ctx, metav1.ListOptions{})
volumeAttachments, err := kubeClient.StorageV1().VolumeAttachments().List(ctx, metav1.ListOptions{
TimeoutSeconds: pointer.Int64Ptr(2)})
if err != nil {
return nil, err
}
Expand All @@ -517,6 +518,8 @@ func (d *DriverCore) getUsedLunsFromVolumeAttachments(ctx context.Context, nodeN
klog.V(2).Infof("volumeAttachments is nil")
return usedLuns, nil
}

klog.V(2).Infof("volumeAttachments count: %d, nodeName: %s", len(volumeAttachments.Items), nodeName)
for _, va := range volumeAttachments.Items {
klog.V(6).Infof("attacher: %s, nodeName: %s, Status: %v, PV: %s, attachmentMetadata: %v", va.Spec.Attacher, va.Spec.NodeName,
va.Status.Attached, pointer.StringDeref(va.Spec.Source.PersistentVolumeName, ""), va.Status.AttachmentMetadata)
Expand Down

0 comments on commit 8788b24

Please sign in to comment.