kubernetes-sigs / kubernetes-sigs/controller-runtime
Allow a result that indicates the reconciliation is incomplete and does not trigger the exponential backoff logic
- Dominant language
- Go
- Stars
- 3k
- Forks
- 1.3k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 14
Description
After discussing this with @detiber, we realized there's no good solution for the following case:
* A request is received
* The request cannot proceed because of a missing dependency on resource _A_
* The reconciler is watching events for resource _A_
* The reconciler returns a result that indicates the reconciliation is incomplete due to reason _X_, but the request should not be requeued
Instead [the current logic](https://github.com/kubernetes-sigs/controller-runtime/blob/053233652960f536727e1980eb0ad8ceb9bef096/pkg/internal/controller/controller.go#L214-L235) is:
* A reconciler is using one or more watches to trigger requests
* A request cannot proceed due to a missing dependency
* If `result.RequeueAfter > 0` then the request is added to the queue for processing after the value specified by `result.RequeueAfter`
* If `result.Requeue` is `true` then the request is added to the queue with the same exponential backoff logic used when an error is returned
* If an error is returned then the request is added to the queue with the exponential backoff logic
Today there is currently no way to indicate a reconciliation is incomplete without also having the request requeued by the manager either via an explicit amount of time or the exponential backoff logic (due to error or `Requeue == true`).
There should be a way to signal:
* The reconciliation is incomplete
* Do not requeue, the reconciler is watching the resources necessary to trigger its own events
Thanks!
Contributor guide
Research direction
Start by reading pkg/internal/controller/controller.go around lines 214-235, especially how RequeueAfter, Requeue, and errors affect queueing. Trace the result handling and surrounding reconciliation flow to determine where an incomplete result could avoid requeueing while watches trigger future requests. Done means the behavior is defined and covered for incomplete reconciliation without explicit or exponential requeue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100