Skip to content

[resource controller] add an option to re-schedule a request #369

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

Closed
lburgazzoli opened this issue Mar 11, 2021 · 5 comments
Closed

[resource controller] add an option to re-schedule a request #369

lburgazzoli opened this issue Mar 11, 2021 · 5 comments
Labels
feature triage/support Indicates an issue that is a support question.

Comments

@lburgazzoli
Copy link
Collaborator

The method UpdateControl<R> createOrUpdateResource(R resources, Context<R> context); has no option to reschedule a request. Usually you should rely on event source but sometimes it is much more simpler to reschedule a reuqest (which is possible in the golang based sdk).

Something like:

UpdateControl.reschedule(delay)

Would IMHO, be useful

@lburgazzoli
Copy link
Collaborator Author

lburgazzoli commented Mar 12, 2021

To expand a little bit more: as part of the reconcile logic of my operator, I need to perform some interaction with an external HTTP service which of course can fail for a number of reasons so as today, the option I have to retry are:

  1. throw an exception which would work but it does not give control about when the next reconcile will happen and you may want to implement some logic like back-off
  2. extract the TimerEventSource from the context and and use one of the related schedule method, which would work but looking at the code, it's availability depends on the EventSourceManager implementation (i.e. the default one, has an option to turn on/off the registration of the timer task)
  3. register my own TimerEventSource in the EventSourceManager.

Option 3 seems to be the safest one in my case but still wonder if such shenario should be supported out of the box ot at least have a documentation that explain how to properly implement it.

@wtrocki
Copy link

wtrocki commented Mar 16, 2021

A good example would be operators interacting with API. We need to be able to reschedule requests.

Scheduler API provides this capability but that is global - we can check things at some time period.

@lburgazzoli
The workaround for now is to edit some made-up field in the metadata - then the operator will pick that as event and reschedule - although this is very hacky thing to do :)

@cortex93
Copy link

Periodic reconciliation seems to be a very common use case, that it shouldn't be a big overhead to have the controller base class register it's own TimerEventSource.
I'm using Option 3 without trouble but being closer to the golang SDK would benefit to the whole ecosystem.

@jmrodri jmrodri added feature triage/support Indicates an issue that is a support question. labels Aug 19, 2021
@cortex93
Copy link

cortex93 commented Oct 5, 2021

@csviri should this be closed by #570

@csviri
Copy link
Collaborator

csviri commented Oct 5, 2021

yes, will close this. thx!

@csviri csviri closed this as completed Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature triage/support Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

5 participants