-
Notifications
You must be signed in to change notification settings - Fork 1.2k
📖 Add more docs to SyncPeriod #3269
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
📖 Add more docs to SyncPeriod #3269
Conversation
Hi @guettli. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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. |
7617cb7
to
b8634e5
Compare
b8634e5
to
1ba19c0
Compare
536b991
to
8a14d92
Compare
8a14d92
to
e22988f
Compare
e22988f
to
dd7366b
Compare
SyncPeriod is likely to get ignored if you use a predicate. This PR updates the docs to make this more obvious.
dd7366b
to
4808f19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
LGTM label has been added. Git tree hash: 3a9ef1ea95f09638ba9f2443adec23981f485c84
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, guettli 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 |
@@ -172,6 +172,17 @@ type Options struct { | |||
// is "done" with an object, and would otherwise not requeue it, i.e., we | |||
// recommend the `Reconcile` function return `reconcile.Result{RequeueAfter: t}`, | |||
// instead of `reconcile.Result{}`. | |||
// | |||
// SyncPeriod will trigger update events with the old object being equal to the new | |||
// object, except when the cache was out of sync. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
except when the cache was out of sync
I'm not sure that this is true. Do we have evidence that informer sometimes trigger update events with old object != new object during resync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote that, because I thought that this is what SyncPeriod should do: Check if the local cache is in-sync with the api-server. But the question of Stefan makes sense: Do we have evidence?
@alvaroaleman Do you know more about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Simplified version) Every syncPeriod the informer takes all objects that are stored locally and sends out update events for them.
I took a look at the implementation, but for me it's not clear if oldObj/newObj are always identical or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that this is a sync between the api-server and the local cache :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope :) But that's a very frequent misunderstanding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-reading the rest of the godoc above. While it contains a lot of correct information I can see how it's misleading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SyncPeriod is likely to get ignored if you use a predicate.
This PR updates the docs to make this more obvious.
Quoting Stefan Büringer
Related: SyncPeriod does not work if controller is created WithEventFilter(predicate.GenerationChangedPredicate{}) · Issue #2355 · kubernetes-sigs/controller-runtime