-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add requeueAfter
to volume deletion flow
#1158
base: main
Are you sure you want to change the base?
Add requeueAfter
to volume deletion flow
#1158
Conversation
@@ -125,7 +127,7 @@ func (r *VolumeReconciler) deleteGone(ctx context.Context, log logr.Logger, volu | |||
} | |||
if !ok { | |||
log.V(1).Info("Not all iri volumes are gone, requeueing") | |||
return ctrl.Result{Requeue: true}, nil | |||
return ctrl.Result{Requeue: true, RequeueAfter: 5 * time.Second}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this configurable via a flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also
// RequeueAfter if greater than 0, tells the Controller to requeue the reconcile key after the Duration.
// Implies that Requeue is true, there is no need to set Requeue to true at the same time as RequeueAfter.
RequeueAfter time.Duration
requeueAfter
to volume deletion flow
@@ -198,7 +200,7 @@ func (r *VolumeReconciler) delete(ctx context.Context, log logr.Logger, volume * | |||
} | |||
if !ok { | |||
log.V(1).Info("Not all iri volumes are gone, requeueing") | |||
return ctrl.Result{Requeue: true}, nil | |||
return ctrl.Result{Requeue: true, RequeueAfter: 5 * time.Second}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh. I'm not sure if we should use a "fixed" delay, since we are working actively against the controller-runtime
requeue mechanism with an exponential backoff. Waiting a fixed time multiplies if we build multiple layers of the brokers/poollets
. Wdyt about returning an error to circumvent this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think even without returning an error we already have the optimal behavior: https://github.com/kubernetes-sigs/controller-runtime/blob/main/pkg/reconcile/reconcile.go#L99-L112
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If the error is nil and result.RequeueAfter is zero and result.Requeue is true, the request
// will be requeued using exponential backoff.
Proposed Changes
Fixes #1155