You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Route status conditions are emitted in non-deterministic order, causing unnecessary status updates #10182
Description:
While working on #10180, I found that when a route parent has errors of more than one condition type (e.g. ResolvedRefs and BackendsAvailable), the order of those conditions in the route status changes between translations.
Example (one rule with a valid backendRef, a backendRef without ready endpoints, and a non-existent Service):
TypedErrorCollector groups errors in a map, and Types() / GetAllErrors() return them in map iteration order (internal/gatewayapi/status/error.go). Route conditions are reset and rebuilt on every translation, so the error-derived conditions are appended in random order.
Nothing on the way to the API server normalizes the order:
The watchable map only skips notifying subscribers when the new value is reflect.DeepEqual to the previous one, and that comparison is order-sensitive.
The provider replaces the whole RouteParentStatus (mergeRouteParentStatus).
isStatusEqual uses cmp.Equal, which only ignores LastTransitionTime and is also order-sensitive, so a reordered status is treated as changed and written with Status().Update().
Impact:
For affected routes, any re-translation (e.g. triggered by an unrelated resource change in the same GatewayClass) can cause: unnecessary status writes to the API server
Activity