Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions changelogs/unreleased/6295-tsaarni-small.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
If there were no relevant resources for Contour in the watched namespaces during the startup of a follower instance of Contour, it did not reach a ready state.
12 changes: 12 additions & 0 deletions internal/contour/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ func (e *EventHandler) Start(ctx context.Context) error {
return
}

// It may be that there are no resources at all to process in watched namespaces.
// Initial (empty) DAG build is not needed and we can mark it as built immediately to allow the XDS server to start.
if e.syncTracker.HasSynced() {
e.initialDagBuilt.Store(true)
}

for {
// In the main loop one of four things can happen.
// 1. We're waiting for an event on op, stop, or pending, noting that
Expand Down Expand Up @@ -190,6 +196,12 @@ func (e *EventHandler) Start(ctx context.Context) error {
if updateOpAdd, ok := op.(opAdd); ok {
if updateOpAdd.isInInitialList {
e.syncTracker.Finished()

// If this was the last event in the initial list but none of the events triggered DAG rebuild,
// then we can mark the (empty) DAG as built to allow the XDS server to start.
if e.syncTracker.HasSynced() && timer == nil {
e.initialDagBuilt.Store(true)
}
}
}
case <-pending:
Expand Down