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
{{ message }}
This repository was archived by the owner on Mar 3, 2025. It is now read-only.
In the controller's Reconcile function, the existing logic creates the unpack job and obtains the pods for the job and if there is an error during the parsing of unpack logs to obtain the pods, then we check if the error is due to pod not being present and if it is, then we requeue after 10s. This is essentially polling for every 10s even when no events come in, and it also leads to ignoring any events that come between 0-10s.
Ideally, we should reconcile when the state of the job changes instead of polling. Therefore, the better solution is to put an OwnerReference on the job (which we already do) and create an OwnerReference based watch on the job such that we reconcile when state of the job changes. We may also need to do a similar thing for the underlying pod itself.
Also, instead of doing a RequeueAfter for every 10s, we should just return the error as that would trigger exponential backoff.
In the controller's
Reconcilefunction, the existing logic creates the unpack job and obtains the pods for the job and if there is an error during the parsing of unpack logs to obtain the pods, then we check if the error is due to pod not being present and if it is, then we requeue after 10s. This is essentially polling for every 10s even when no events come in, and it also leads to ignoring any events that come between 0-10s.Ideally, we should reconcile when the state of the job changes instead of polling. Therefore, the better solution is to put an
OwnerReferenceon the job (which we already do) and create anOwnerReferencebased watch on the job such that we reconcile when state of the job changes. We may also need to do a similar thing for the underlying pod itself.Also, instead of doing a
RequeueAfterfor every 10s, we should just return the error as that would trigger exponential backoff.See: #34 (comment)