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

MaxRetries: counter is reset on every resource submission #317

Open
eytan-avisror opened this issue Jun 28, 2021 · 0 comments
Open

MaxRetries: counter is reset on every resource submission #317

eytan-avisror opened this issue Jun 28, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@eytan-avisror
Copy link
Collaborator

_, err = kube.Resource(GVR).Namespace(customResourceNamespace).Create(context.Background(), customResource, metav1.CreateOptions{})
if err != nil {
if !kerr.IsAlreadyExists(err) {
return false, errors.Wrap(err, "failed to submit custom resource")
}
} else {
log.Info("submitted custom resource", "instancegroup", instanceGroupNamespacedName)
status.SetStrategyRetryCount(0)
}

The above logic states - if there is an error in creating a resource, and it already exists - do nothing, or fail if otherwise.
If creation is successful - reset the maxRetry counter, this is problematic in the cases where the creation is due to replacement of a failed CR, causing an infinite retry scenario, which is not the intention.

We should evaluate not resetting the counter there and test out various concurrency policies with it.

@eytan-avisror eytan-avisror added the bug Something isn't working label Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant