Skip to content

RuleReconciler returns RequeueAfter together with an error, which controller-runtime ignores and warns about #468

Closed

Description

@DsThakurRawat

What happened?

Five return sites in internal/controller/nodereadinessrule_controller.go (lines 147, 158, 165, 171 and 198 on main) return ctrl.Result{RequeueAfter: time.Minute}, err. controller-runtime discards RequeueAfter whenever the error is non-nil: the request goes back through the rate limiter with exponential backoff, and each such return logs Warning: Reconciler returned both a result with either RequeueAfter or Requeue set and a non-nil error. RequeueAfter and Requeue will always be ignored if the error is non-nil. (pkg/internal/controller/controller.go:491-492 in v0.24.1, the version in go.mod). So the one-minute retry the code asks for is not what runs, and a persistent failure adds a warning line on every attempt. NodeReconciler.Reconcile returns ctrl.Result{}, err on the equivalent path (node_controller.go:107), so the two reconcilers disagree.

Steps to Reproduce

Observed by reading, not by running. Any error that persists across reconciles of a rule, for example the invalid taint value in #467 or a status patch that keeps failing, will show the warning above in the controller log on each attempt, with the gap between attempts growing rather than staying at one minute.

Expected Behavior

Either return ctrl.Result{}, err, so the documented backoff applies without the warning, or, if a fixed one-minute cadence is really wanted, log the error and return RequeueAfter with a nil error.

Controller Version / Image Tag

main (commit 80f59f3)

Kubernetes Version

Not applicable.

Controller Logs

The controller-runtime warning quoted above.

Additional Environment Details

Five-line change. #363 touches the same file, so whichever lands second rebases. I can send it once #466 is through, to keep one PR from me open here at a time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions