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

[feature]: Exponential backoff for entity controllers #787

Open
ian-buse opened this issue Jul 2, 2024 · 0 comments
Open

[feature]: Exponential backoff for entity controllers #787

ian-buse opened this issue Jul 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ian-buse
Copy link
Contributor

ian-buse commented Jul 2, 2024

Is your feature request related to a problem? Please describe.

If an entity controller throws an exception, the entity does not get re-queued and is effectively dead until some event causes another reconciliation. Besides catching the exceptions, the operator SDK does not have any built-in support for error handing from entity controllers.

This means that all exception/error handling has to be done within the controller, and there are limitations to this approach, especially if you want an exponential backoff (which is common in Kubernetes land).

Describe the solution you would like

First, I would like to be able to configure the backoff with a few parameters, such as MaxRetries, MinDuration, and MaxDuration. I think this could be done in the OperatorSettings. Maybe people would want this configurable per-entity though? I don't know.

As for the controllers themselves, there are a few approaches I thought might work:

  • Use a custom exception that can be caught by the SDK to signal that the resource failed to reconcile.
  • Instead of the controllers returning a Task, they could return a Task<EntityControllerResult> or something like that, in some ways similar to how the v7 operator worked.
  • Maybe the EntityRequeue<TEntity>(TEntity, TimeSpan) delegate could be changed?

Additional Context

No response

@ian-buse ian-buse added the enhancement New feature or request label Jul 2, 2024
@ian-buse ian-buse changed the title [feature]: Exponential backoff for resource controllers [feature]: Exponential backoff for entity controllers Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant