Skip to content

Conversation

@chandler-solo
Copy link
Contributor

Description

The alternative is to sleep for 20ms. This is more like what Istio pilot does in its 'EnsureSynced' function.

Will prevent the TestXDSUpdate flake seen in https://github.com/kgateway-dev/kgateway/actions/runs/20791862732/job/59715696984?pr=13232

Change Type

/kind flake

Changelog

NONE

Additional Notes

The alternative is to sleep for 20ms. This is more like what Istio pilot does
in its 'EnsureSynced' function.

Will prevent the TestXDSUpdate flake seen in https://github.com/kgateway-dev/kgateway/actions/runs/20791862732/job/59715696984?pr=13232

Signed-off-by: David L. Chandler <[email protected]>
howardjohn and others added 2 commits January 8, 2026 09:31
* Move our 'update inbound' to be earlier; the old logic was too late so
  we could see 0 inbound updates

Signed-off-by: John Howard <[email protected]>
@chandler-solo chandler-solo marked this pull request as ready for review January 8, 2026 17:46
go s.sendPushes(stopCh)
for _, reg := range s.registrations {
go reg.Start(stopCh)
reg.Start(stopCh)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this means there's no blocking startup?

return CollectionRegistration{
Start: start,
HasSynced: synced,
HasSynced: synced.Load,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now HasSynced doesn't mean the krt collection has synced? It's tied to the WaitUntilSynced handler. Maybe we should rename HasSynced so it's less confusing with other places we use the collection has synced ex.

func (c *AgwCollections) HasSynced() bool {

synced := func() bool {
return nc.HasSynced()
go func() {
handler.WaitUntilSynced(stop)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, should we wrap this in a timeout or a stop channel? Is WaitUntilSynced blocking until the krt collection reports that it has synced all resources?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@howardjohn do we need this or is it fine as is?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aitUntilSynced(stop) will exit early if stop chan is closed

}
pushChannel <- &pr
s.InboundUpdates.Inc()
s.pushChannel <- &pr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to buffer the pushChannel now that we have the longer WaitUntilSynced? It's probably not a problem but maybe worth adding a future todo here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants