- Notifications
You must be signed in to change notification settings - Fork 1.2k
🐛 Error when source.Start() never returns #2997
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
Conversation
| [APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman The full list of commands accepted by this bot can be found here. The pull request process is described here Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
94029d0 to 5faad47 Compare Contrary to everything else in controller-runtime, we expect `source.Start` to be non-blocking. If someone implements a custom source and gets this wrong, the resulting behavior is that the binary starts successfully, but no reconciliation happens which is extremely difficult to understand and debug. This change makes us use the `CacheSyncTimeout` not only for the sources `WaitForSync` but also for its `Start`. It is worth noting that the current design of both requiring `Start` to not block and `WaitForSync` to block is very confusing. It likely came to be because we basicaly require two distinct contexsts in `Start`, one to indicate the lifetime of the `Source` and one to indicate the `Start` timeout. To overall simplify and improve the code, the change also parallelizes the `Start` of the sources.
5faad47 to 8cc205a Compare | /lgtm |
| LGTM label has been added. Git tree hash: f396e706f3c7a54b960ef9bc49e32407f4aa4b17 |
| Wasn't sure this would merge so quickly or else I would've put a hold on it to allow others to review. Do you want to cherry-pick this @alvaroaleman? |
No. No problem, it happens. I will do a follow-up regarding your comment and in case there are more comments |
Addresses kubernetes-sigs#2997 (comment), followup to kubernetes-sigs#2997
Addresses kubernetes-sigs#2997 (comment), followup to kubernetes-sigs#2997
Addresses the comments on kubernetes-sigs#2997
Addresses the comments on kubernetes-sigs#2997
Contrary to everything else in controller-runtime, we expect
source.Startto be non-blocking. If someone implements a custom source and gets this wrong, the resulting behavior is that the binary starts successfully, but no reconciliation happens which is extremely difficult to understand and debug.This change makes us use the
CacheSyncTimeoutnot only for the sourcesWaitForSyncbut also for itsStart.It is worth noting that the current design of both requiring
Startto not block andWaitForSyncto block is very confusing. It likely came to be because we basicaly require two distinct contexsts inStart, one to indicate the lifetime of theSourceand one to indicate theStarttimeout.To overall simplify and improve the code, the change also parallelizes the
Startof the sources.