Skip to content

Commit

Permalink
Merge pull request #2528 from chrischdi/pr-cct-requeue-minute
Browse files Browse the repository at this point in the history
🐛 ClusterCacheTracker: Use RequeueAfter 1 minute instead of immediate requeue when ErrClusterLocked gets returned to not fall into exponential requeue
  • Loading branch information
k8s-ci-robot authored Dec 6, 2023
2 parents 8355988 + 8d65d25 commit de24106
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion controllers/serviceaccount_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"reflect"
"strconv"
"strings"
"time"

"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -210,7 +211,7 @@ func (r *ServiceAccountReconciler) Reconcile(ctx context.Context, req reconcile.
if err != nil {
if errors.Is(err, remote.ErrClusterLocked) {
log.V(5).Info("Requeuing because another worker has the lock on the ClusterCacheTracker")
return ctrl.Result{Requeue: true}, nil
return ctrl.Result{RequeueAfter: time.Minute}, nil
}
log.Error(err, "The control plane is not ready yet")
return reconcile.Result{RequeueAfter: clusterNotReadyRequeueTime}, nil
Expand Down
2 changes: 1 addition & 1 deletion controllers/servicediscovery_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (r *serviceDiscoveryReconciler) Reconcile(ctx context.Context, req reconcil
if err != nil {
if errors.Is(err, remote.ErrClusterLocked) {
log.V(5).Info("Requeuing because another worker has the lock on the ClusterCacheTracker")
return ctrl.Result{Requeue: true}, nil
return ctrl.Result{RequeueAfter: time.Minute}, nil
}
log.Error(err, "The control plane is not ready yet")
return reconcile.Result{RequeueAfter: clusterNotReadyRequeueTime}, nil
Expand Down
2 changes: 1 addition & 1 deletion controllers/vspherevm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func (r vmReconciler) deleteNode(ctx context.Context, vmCtx *capvcontext.VMConte
if err != nil {
if errors.Is(err, remote.ErrClusterLocked) {
log.V(5).Info("Requeuing because another worker has the lock on the ClusterCacheTracker")
return ctrl.Result{Requeue: true}, nil
return ctrl.Result{RequeueAfter: time.Minute}, nil
}
return ctrl.Result{}, err
}
Expand Down

0 comments on commit de24106

Please sign in to comment.