You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the case where Reconcile calls an external API to notify it of some event and may receive an error. I can handle these errors explicitly within Reconcile to avoid some unnecessary requeues for terminal errors, but I may want to configure a default/backstop policy which requeues as normal (i.e. according to the rate limiter), but stops at a specified failureCount. In other words, make it easier to configure the controller to prevent endless requeueing of all "non-terminal" errors, and therefore prevent spamming the external API by default.
From what I can tell, the current way to do this "per-item requeue limit" is to roll a custom Controller implementation and call c.queue.Forget(item) within processNextWorkItem if the failureCount exceeds some hardcoded number. I see this logic present on some of the client-go examples.
Adding this to the controller builder options seems natural, since we already have RateLimiter and this is semi-related. The PerItemRequeueLimit option could default to 0, which we would treat as "infinity". Any int setting greater than zero would allow us to impose the limit by checking NumRequeues and, if the limit is violated, we emit metrics and bypass the requeue.
Consider the case where
Reconcile
calls an external API to notify it of some event and may receive an error. I can handle these errors explicitly withinReconcile
to avoid some unnecessary requeues for terminal errors, but I may want to configure a default/backstop policy which requeues as normal (i.e. according to the rate limiter), but stops at a specified failureCount. In other words, make it easier to configure the controller to prevent endless requeueing of all "non-terminal" errors, and therefore prevent spamming the external API by default.From what I can tell, the current way to do this "per-item requeue limit" is to roll a custom
Controller
implementation and callc.queue.Forget(item)
withinprocessNextWorkItem
if the failureCount exceeds some hardcoded number. I see this logic present on some of the client-go examples.Adding this to the controller builder options seems natural, since we already have
RateLimiter
and this is semi-related. ThePerItemRequeueLimit
option could default to0
, which we would treat as "infinity". Any int setting greater than zero would allow us to impose the limit by checkingNumRequeues
and, if the limit is violated, we emit metrics and bypass the requeue.The text was updated successfully, but these errors were encountered: