Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

balpert89
Copy link
Contributor

Proposed Changes

  • add a delay of 5 seconds when IRI volumes are not yet completely removed

Fixes #1155

@balpert89 balpert89 requested a review from a team as a code owner November 18, 2024 16:28
@github-actions github-actions bot added bug Something isn't working size/S labels Nov 18, 2024
@@ -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
Copy link
Member

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?

Copy link
Member

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

@afritzler afritzler added enhancement New feature or request and removed bug Something isn't working labels Nov 22, 2024
@afritzler afritzler changed the title fix: add requeueAfter to volume deletion logic Add requeueAfter to volume deletion flow Nov 22, 2024
@@ -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
Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hotfix - add reconcile delay for volume processing
3 participants