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

Reconciliation reason gets stuck as "reconciler requested retry" even if short-circuited #1114

Closed
nightkr opened this issue Jan 3, 2023 · 1 comment · Fixed by #1260
Closed
Labels
bug Something isn't working runtime controller runtime related

Comments

@nightkr
Copy link
Member

nightkr commented Jan 3, 2023

Current and expected behavior

Currently, a reconciler that returns Ok(controller::Action::requeue(Duration::from_secs(10))) will always have the reconciliation reason be listed as "reconciler requested retry", even if they are triggered by an actual change. Instead, the overriding change should take priority and be listed instead.

Possible solution

Currently, the controller (scheduler, actually) latches on to the first reason that it sees to schedule any given reconciliation. Instead, it should use the reason behind the earliest time to reconcile, just like how the scheduler currently allows subsequent requests to cause the reconciliation to happen earlier.

I suspect that this means that ScheduleRequest will need to take an extra reason parameter, which we'd move into ScheduledEntry.

Additional context

No response

Environment

This is a kube-runtime issue, the cluster is irrelevant.

Configuration and features

kube = { version = "0.77.0", features = ["runtime"] }

Affected crates

kube-runtime

Would you like to work on fixing this bug?

yes

@nightkr nightkr added bug Something isn't working runtime controller runtime related labels Jan 3, 2023
@aryan9600
Copy link
Contributor

aryan9600 commented Jul 4, 2023

hey i'd like to take this on, if thats okay. i had a question regarding the new reason field.

so ScheduleRequest has a message field which is generic, but the controller always populates it with a ReconcileRequest object which already has a field called reason. so, i was wondering if we could reuse that somehow instead of introducing a new field in ScheduleRequest, but i guess it isn't possible because we want to keep the scheduler as generic as possible and free of any controller/reconciler specific code and APIs. this is making me think about the type of the new reason field that needs to be added in ScheduleRequest. these are the options i can think of:

  • String (maybe a bit inflexible, but acceptable imo)
  • ReconcileReason/Into<ReconcileReason> (defeats the purpose of keeping the scheduler generic)
  • a new type: ScheduleReason

i'm open to other suggestions as well :)

nightkr added a commit to nightkr/kube-rs that referenced this issue Jul 8, 2023
In practice this should update the reconciliation reason, fixing kube-rs#1114
nightkr added a commit to nightkr/kube-rs that referenced this issue Jul 20, 2023
In practice this should update the reconciliation reason, fixing kube-rs#1114

Signed-off-by: Natalie Klestrup Röijezon <nat@nullable.se>
clux pushed a commit that referenced this issue Jul 20, 2023
* Update the scheduler message when preponing

In practice this should update the reconciliation reason, fixing #1114

Signed-off-by: Natalie Klestrup Röijezon <nat@nullable.se>

* Move `SingletonMessage` out of the individual tests

Signed-off-by: Natalie Klestrup Röijezon <nat@nullable.se>

---------

Signed-off-by: Natalie Klestrup Röijezon <nat@nullable.se>
@clux clux linked a pull request Jul 20, 2023 that will close this issue
@clux clux closed this as completed Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working runtime controller runtime related
Projects
None yet
3 participants