Skip to content

Commit

Permalink
[ISSUE-1246]: increased retry count, improved logging
Browse files Browse the repository at this point in the history
Signed-off-by: Dawid Korzepa <[email protected]>
  • Loading branch information
korzepadawid committed Dec 9, 2024
1 parent 47da5e4 commit 28d4bcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/crcontrollers/drive/drivecontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (c *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
switch status {
case update:
if err := c.client.UpdateCR(ctx, drive); err != nil {
log.Errorf("Failed to update Drive %s CR", driveName)
log.Errorf("Failed to update Drive %s CR, error: %s", driveName, err.Error())
return ctrl.Result{}, client.IgnoreNotFound(err)
}
case remove:
Expand Down
3 changes: 2 additions & 1 deletion pkg/node/volumemgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const (
// Discover function replaces drive health with passed value if the annotation is set
driveHealthOverrideAnnotation = "health"

numberOfRetries = 2
numberOfRetries = 5
delayBeforeRetry = 2
)

Expand Down Expand Up @@ -400,6 +400,7 @@ func (m *VolumeManager) retryDriveUpdate(ctx context.Context, volume *volumecrd.
m.addVolumeStatusAnnotation(drive, volume.Name, apiV1.VolumeUsageReleased)
}
if err := m.k8sClient.UpdateCR(ctx, drive); err != nil {
ll.Infof("Volume annotation on drive %s failed, error: %s", drive.Name, err.Error())
ll.Infof("Retrying to update drive %s usage status to %s. Retry number: %d. Sleep %d seconds and retry ...",
drive.Name, drive.Spec.Usage, i, delayBeforeRetry)
time.Sleep(time.Second * delayBeforeRetry)
Expand Down

0 comments on commit 28d4bcc

Please sign in to comment.