-
Notifications
You must be signed in to change notification settings - Fork 681
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
Use polling during startup to wait for informers to sync #6614
Conversation
ed7b7de
to
a8ea16b
Compare
3046ee2
to
7693441
Compare
7693441
to
cfcf22d
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6614 +/- ##
==========================================
+ Coverage 81.01% 81.04% +0.02%
==========================================
Files 133 133
Lines 19997 20001 +4
==========================================
+ Hits 16201 16210 +9
+ Misses 3503 3498 -5
Partials 293 293
|
Fix after test case failure. Coverage target is bit difficult to reach for this one. |
The Contour project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
The Contour project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
The Contour project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
cfcf22d
to
5c542fb
Compare
The "upstream" informer trackers do not always return HasSynced() == true immediately, even if we have already processed all events the informer dispatched us. Change to polling so that we can progress also in that case. Signed-off-by: Tero Saarni <tero.saarni@est.tech>
5c542fb
to
63fcd50
Compare
This change will use polling for
HasSynced()
call to align with how client-go'sWaitForCacheSync()
operates. Previously it was only called when we received objects from the informer. By changing to polling, we prevent a race condition where Contour fails to recognize that the final object in the initial list has been received, which would prevent the xDS server from ever starting.Fixes #6613
Details
The startup of a follower instance depends on informers signaling that they have finished synchronizing resources with the API server. We use the
SingleFileTracker
from client-go to track the processing of initial objects. This tracker increments when processing starts on a resource and decrements when its finished.The
HasSynced()
method should ideally report synchronization statustrue
right afterFinished()
is called for the last resource in the initial list (tracker reaches zero). However, in some cases it fails to reporttrue
immediately, causig the boolean trigger that starts the xDS server to never be set.In case of a leader instance, an extra update triggered by the leader selection itself has ensured that the xDS server starts.