Repository navigation
Add --cache-sync-timeout flag for sync controllers - #210
Conversation
|
Hi @Wompipomp. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
@Wompipomp merged what I can for current release. Ping us in kcp-dev stack and if you need we can make patch release for you if you need rest of the changes in more urgent matter :) thanks for these :) |
Sync controllers are created unmanaged, so the manager's controller configuration does not apply and controller-runtime always falls back to its 2m default CacheSyncTimeout. On startup, the informers for a PublishedResource with many objects (tens of thousands, or large ones) may need longer than that to sync, which makes the sync controller fail to start. The controller is then restarted with backoff, but every attempt until the informers have synced fails and delays syncing. Add a --cache-sync-timeout flag and pass it through to the options of each per-PublishedResource sync controller. The default stays at 2m, so the behaviour does not change unless the flag is set. on-behalf-of: @eon-se opensource@eon.com Signed-off-by: Mark Altmann <mark.altmann.external@eon.com>
ede2f9d to
1f41643
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjudeikis, xrstf The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM label has been added. DetailsGit tree hash: 089cadd48096af58a42e2286cda2d15878df2707 |
Summary
Sync controllers are created unmanaged, so the manager's controller configuration does not apply
and controller-runtime always uses its 2m default
CacheSyncTimeout. On startup, the informer for thelocal
Kindsource of a PublishedResource with many (or large) objects can need longer than that, and the synccontroller then fails to start with a cache sync timeout.
This adds a
--cache-sync-timeoutflag that is passed through to the options of everyper-PublishedResource sync controller. The default stays at 2m, so behaviour only changes when the
flag is set. Non-positive values are rejected. Tested with
go test -race ./...andmake lint(no new findings) after the rebase; e2e runs in CI.We run this with
--cache-sync-timeout=5mfor a PublishedResource with ~10,000 objects on theservice cluster; since then all sync controllers start after agent restarts. This complements
restarting failed controllers (#201): the retry recovers a controller after the timeout, the flag
avoids the failed first attempts.
Rebased onto
mainafter #201 and #205 (the new flag sits next to--worker-count).What Type of PR Is This?
/kind feature
Related Issue(s)
Fixes #207
Release Notes