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
bug: non-deterministic proto marshaling republishes equivalent xDS resources on every translation #10018
Envoy Gateway wraps every filter typed_config into a google.protobuf.Any via ToAnyWithValidation (internal/utils/proto/proto.go), which calls anypb.New. anypb.New uses the default, non-deterministic marshaler, so proto map fields serialize in a random
key order on each translation.
As a result, a semantically unchanged resource is emitted with different wire bytes on nearly every reconcile. Consumers that key off the serialized bytes then see a constant stream of equivalent updates: go-control-plane's delta-ADS per-resource hash and Envoy's own config hash both compare the encoded bytes. For map fields Envoy normalizes the config and treats the update as a no-op (continuous no-op LDS/CDS pushes, no traffic impact); the same class of non-determinism in a repeated field instead causes filter-chain replacement and connection drains (#8889).
Concrete example: with a JSON access log configured, the Listener's HttpConnectionManager access log json_format (a google.protobuf.Struct, i.e. a map) reorders its keys on every translation. Decoding two consecutive Listener payloads shows the same set of fields in a different order (byte-different, semantically identical). The same happens for other map-bearing configs (JWT providers, filter metadata, per-route typed_per_filter_config).
This is the general root cause behind the narrowly-scoped fixes already merged for individual fields (#9042 sorted api key auth credentials; #9430 deduplicates JWT providers). Making the marshaling deterministic addresses the whole class at the source.
Repro steps:
Configure a Gateway/HTTPRoute with a JSON access log (or any config carrying a map field).
Trigger repeated reconciles (e.g. unrelated endpoint/route churn in the cluster).
Capture the Listener xDS resource on two consecutive reconciles and compare the raw bytes (not the decoded JSON, which re-sorts map keys).
Observe the json_format map entries in a different order: byte-different, semantically identical, republished each reconcile.
Expected behavior:
An unchanged effective configuration produces byte-stable xDS resources, so equivalent resources are not republished on every reconcile.
Activity