Skip to content
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

vai: document resync period #463

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions pkg/sqlcache/informer/informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,15 @@ func NewInformer(client dynamic.ResourceInterface, fields [][]string, transform
example := &unstructured.Unstructured{}
example.SetGroupVersionKind(gvk)

// avoids the informer to periodically resync (re-list) its resources
// currently it is a work hypothesis that, when interacting with the UI, this should not be needed
// TL;DR: this disables the Informer periodic resync - but this is inconsequential
//
// Long version: Informers use a Reflector to pull data from a ListWatcher and push it into a DeltaFIFO.
// Concurrently, they pop data off the DeltaFIFO to fire registered handlers, and also to keep an updated
// copy of the known state of all objects (in an Indexer).
// The resync period option here is passed from Informer to Reflector to periodically (re)-push all known
// objects to the DeltaFIFO. That causes the periodic (re-)firing all registered handlers.
// In this case we are not registering any handlers to this particular informer, so re-syncing is a no-op.
// We therefore just disable it right away.
resyncPeriod := time.Duration(0)

sii := newInformer(listWatcher, example, resyncPeriod, cache.Indexers{})
Expand Down
Loading