Repository navigation
fix(agent): always publish out_http so the egress listener's RDS resolves (#817) - #839
Merged
Merged
Conversation
…lves (#817) The node's egress listener routes over RDS for `out_http`, but the snapshot builder emitted that route config only when `len(vhosts) > 0`. An agent that starts with nothing to publish — the local-only fallback `loadInitialRegistryConfig` takes when the registry cannot serve endpoints within its 15s budget — therefore published no route config at all. Under delta ADS that is not "an empty route table", it is NO RESPONSE AT ALL. go-control-plane's `respondDelta` writes a response only when the subscription yields resources or removals, and a first-time RDS subscriber to a name the snapshot has never carried yields neither (`found` is false in `createDeltaResponse`, so it is not even a removal). The watch stays open and silent, Envoy's `out_http` init target never fires, the egress listener warms for the full `initial_fetch_timeout` and then activates with an unresolved route table — 404 NR route_not_found on everything until a later snapshot finally carries `out_http`. Measured on main-worker-02, 2026-09-19: LDS at 16:08:50.558Z, first 404 at 16:09:05.214Z (14.7s, i.e. Envoy's 15s default timeout), last 404 at 16:09:08.032Z, first `out_http` RDS update 91ms later. The listener served traffic for ~17.5s before its route table existed. Changes: - `out_http` is now emitted unconditionally, exactly as the edge and capture route configs already are, so the subscription resolves on the first push. Its on-demand catch-all makes the zero-vhost table a working one: the liveness 200, mesh-shaped authorities to their cluster via ODCDS, and a hard 404 for anything foreign. - The egress RDS config source now states `initial_fetch_timeout` explicitly at 15s. That is Envoy's own default, so this is a pin rather than a behaviour change; it is also the agent's `registryReadyTimeout`, and a shorter budget would let a fresh epoch activate while the agent feeding it is still inside its own initial-snapshot budget. 0 (wait forever) is rejected deliberately: it would wedge the listener in warming for the life of the process. - Both route-config builders now own their `virtual_hosts` slice instead of appending the catch-all onto the caller's backing array. Tests: a zero-vhost snapshot must publish a resolvable `out_http` carrying the catch-all (fails on main with `map[string]types.Resource(nil) does not contain "out_http"`); the same for a node whose dependency set empties; the RDS `initial_fetch_timeout` is asserted both on the built filter chain and on the serialised node bootstrap; and `//test/envoy_validate` gained a scenario that runs the zero-vhost `out_http` table through a real Envoy config loader. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This was referenced Sep 20, 2026
bpalermo
added a commit
that referenced
this pull request
Sep 20, 2026
…reuse depends on (#852) aether is safe today, and documentation-only — no behaviour changes. But #852's two premises are both wrong at the pinned Envoy (1.40.0-dev.20260904.13144fb), so the comment records what the source actually says rather than what the issue assumed. Correction 1: initial_fetch_timeout is EXEMPT from the RDS reuse key, not "the first field released into it". addDynamicProvider releases config_source.initial_fetch_timeout before MessageUtil::hash and restores it after (source/common/rds/route_config_provider_manager.h:47-54), so two listeners differing only there still share one provider. #839's field is the one addition that could never have split anything. The exemption is RDS-only: scoped RDS, ECDS and ODCDS hash it in. Correction 2: a map-typed field cannot split a provider. MessageUtil::hash is DeterministicProtoHash::hash on any normal build (utility.cc:166-172) — a reflection walk, not a serialisation — and it folds map entries with ADDITION precisely so order cannot matter (deterministic_hash.cc:78-100). Repeated NON-map fields ARE walked in order and are hash-significant. So the live Envoy-side hazard is a repeated field built by ranging a Go map (ConfigSource.authorities, api_config_source's grpc_services / initial_metadata / config_validators) or a genuine semantic divergence between call sites — not serialisation skew. Maps stay a go-control-plane-side snapshot-version hazard, which is #135's mechanism, currently closed by the Deterministic marshals in TypedConfig and cache MarshalResource. Blast radius, likewise corrected. It is NOT doubled RDS traffic: ads:{} resolves to the one process-wide ADS mux, which rebuilds resource_names through a dedup set on every request (grpc_mux_impl.cc:178-190), so the cost is a single redundant DiscoveryRequest at addWatch and zero steady-state bytes. It is NOT a new stat series where the HCM stat_prefixes match: the allocator dedupes by stat name (allocator.cc:299-316), so one series reads DOUBLE — which is aether's case for out_http and cap_http, whose stat_prefixes are the constants "outbound_http" and "capture_http", while the per-Gateway edge listeners take theirs from the listener name and would split into two trees. The unambiguous signal is /config_dump, where dumpRouteConfigs emits one dynamic_route_configs entry per provider. The real costs are two parsed route tables per worker, a second parse/build per push, and independent warming. No NACK and no warning is right. Adds three guards, all confirmed red before landing: - TestConfigSourceBytesIdenticalAcrossConstructions: twelve independent constructions of every ConfigSource this package hands out must serialise identically. Uses a PLAIN proto.Marshal deliberately — Deterministic:true canonicalises map fields and would go quiet on half of what this is for. - TestConfigSourceCarriesNoMapField: walks the populated message tree and fails on any set map-typed field, which the byte comparison misses for a one-entry map. - TestOutboundChainRDSIdenticalAcrossPods: two pods differing in every field the chain builder reads must produce a byte-identical out_http Rds. Deliberately stricter than Envoy's own key. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
added a commit
that referenced
this pull request
Sep 20, 2026
…reuse depends on (#852) aether is safe today, and documentation-only — no behaviour changes. But #852's two premises are both wrong at the pinned Envoy (1.40.0-dev.20260904.13144fb), so the comment records what the source actually says rather than what the issue assumed. Correction 1: initial_fetch_timeout is EXEMPT from the RDS reuse key, not "the first field released into it". addDynamicProvider releases config_source.initial_fetch_timeout before MessageUtil::hash and restores it after (source/common/rds/route_config_provider_manager.h:47-54), so two listeners differing only there still share one provider. #839's field is the one addition that could never have split anything. The exemption is RDS-only: scoped RDS, ECDS and ODCDS hash it in. Correction 2: a map-typed field cannot split a provider. MessageUtil::hash is DeterministicProtoHash::hash on any normal build (utility.cc:166-172) — a reflection walk, not a serialisation — and it folds map entries with ADDITION precisely so order cannot matter (deterministic_hash.cc:78-100). Repeated NON-map fields ARE walked in order and are hash-significant. So the live Envoy-side hazard is a repeated field built by ranging a Go map (ConfigSource.authorities, api_config_source's grpc_services / initial_metadata / config_validators) or a genuine semantic divergence between call sites — not serialisation skew. Maps stay a go-control-plane-side snapshot-version hazard, which is #135's mechanism, currently closed by the Deterministic marshals in TypedConfig and cache MarshalResource. Blast radius, likewise corrected. It is NOT doubled RDS traffic: ads:{} resolves to the one process-wide ADS mux, which rebuilds resource_names through a dedup set on every request (grpc_mux_impl.cc:178-190), so the cost is a single redundant DiscoveryRequest at addWatch and zero steady-state bytes. It is NOT a new stat series where the HCM stat_prefixes match: the allocator dedupes by stat name (allocator.cc:299-316), so one series reads DOUBLE — which is aether's case for out_http and cap_http, whose stat_prefixes are the constants "outbound_http" and "capture_http", while the per-Gateway edge listeners take theirs from the listener name and would split into two trees. The unambiguous signal is /config_dump, where dumpRouteConfigs emits one dynamic_route_configs entry per provider. The real costs are two parsed route tables per worker, a second parse/build per push, and independent warming. No NACK and no warning is right. Adds three guards, all confirmed red before landing: - TestConfigSourceBytesIdenticalAcrossConstructions: twelve independent constructions of every ConfigSource this package hands out must serialise identically. Uses a PLAIN proto.Marshal deliberately — Deterministic:true canonicalises map fields and would go quiet on half of what this is for. - TestConfigSourceCarriesNoMapField: walks the populated message tree and fails on any set map-typed field, which the byte comparison misses for a one-entry map. - TestOutboundChainRDSIdenticalAcrossPods: two pods differing in every field the chain builder reads must produce a byte-identical out_http Rds. Deliberately stricter than Envoy's own key. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
added a commit
that referenced
this pull request
Sep 20, 2026
…reuse depends on (#852) (#857) aether is safe today, and documentation-only — no behaviour changes. But #852's two premises are both wrong at the pinned Envoy (1.40.0-dev.20260904.13144fb), so the comment records what the source actually says rather than what the issue assumed. Correction 1: initial_fetch_timeout is EXEMPT from the RDS reuse key, not "the first field released into it". addDynamicProvider releases config_source.initial_fetch_timeout before MessageUtil::hash and restores it after (source/common/rds/route_config_provider_manager.h:47-54), so two listeners differing only there still share one provider. #839's field is the one addition that could never have split anything. The exemption is RDS-only: scoped RDS, ECDS and ODCDS hash it in. Correction 2: a map-typed field cannot split a provider. MessageUtil::hash is DeterministicProtoHash::hash on any normal build (utility.cc:166-172) — a reflection walk, not a serialisation — and it folds map entries with ADDITION precisely so order cannot matter (deterministic_hash.cc:78-100). Repeated NON-map fields ARE walked in order and are hash-significant. So the live Envoy-side hazard is a repeated field built by ranging a Go map (ConfigSource.authorities, api_config_source's grpc_services / initial_metadata / config_validators) or a genuine semantic divergence between call sites — not serialisation skew. Maps stay a go-control-plane-side snapshot-version hazard, which is #135's mechanism, currently closed by the Deterministic marshals in TypedConfig and cache MarshalResource. Blast radius, likewise corrected. It is NOT doubled RDS traffic: ads:{} resolves to the one process-wide ADS mux, which rebuilds resource_names through a dedup set on every request (grpc_mux_impl.cc:178-190), so the cost is a single redundant DiscoveryRequest at addWatch and zero steady-state bytes. It is NOT a new stat series where the HCM stat_prefixes match: the allocator dedupes by stat name (allocator.cc:299-316), so one series reads DOUBLE — which is aether's case for out_http and cap_http, whose stat_prefixes are the constants "outbound_http" and "capture_http", while the per-Gateway edge listeners take theirs from the listener name and would split into two trees. The unambiguous signal is /config_dump, where dumpRouteConfigs emits one dynamic_route_configs entry per provider. The real costs are two parsed route tables per worker, a second parse/build per push, and independent warming. No NACK and no warning is right. Adds three guards, all confirmed red before landing: - TestConfigSourceBytesIdenticalAcrossConstructions: twelve independent constructions of every ConfigSource this package hands out must serialise identically. Uses a PLAIN proto.Marshal deliberately — Deterministic:true canonicalises map fields and would go quiet on half of what this is for. - TestConfigSourceCarriesNoMapField: walks the populated message tree and fails on any set map-typed field, which the byte comparison misses for a one-entry map. - TestOutboundChainRDSIdenticalAcrossPods: two pods differing in every field the chain builder reads must produce a byte-identical out_http Rds. Deliberately stricter than Envoy's own key. Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #817.
The defect, and a correction to the filed mechanism
The node's egress listener routes over RDS for
out_http(
agent/internal/xds/proxy/filterchain.go), andsnapshot.goemitted that routeconfig only when
len(vhosts) > 0— unlike the edge and capture routeconfigs, which are always emitted so their RDS resolves. An agent that starts
with nothing to publish (the local-only fallback
loadInitialRegistryConfigtakes when the registry cannot serve endpoints inside its 15 s budget) therefore
published no route config at all.
The issue says "no
initial_fetch_timeoutanywhere, so Envoy does not wait".Envoy waited, and it waited exactly 15 s — that field's default is 15 s, and
the measured w02 timeline is a ~15 s wait, not a zero-length one:
update_time404 NR404 NRout_httpRDS update14.656 s is the
initial_fetch_timeoutexpiring, not a listener that neverwaited. That matters for the fix, because it means setting
initial_fetch_timeoutcannot close this window — see below.The reason the subscription was silent for the whole 15 s, rather than being
answered with an empty table, is that the mesh runs delta ADS
(
api_type: DELTA_GRPCin the proxy bootstrap). In go-control-plane v0.14.0:createDeltaResponseputs a subscribed name intoremovedResourcesonly whenit was previously returned (
prevVersion, found := sub.ReturnedResources()[name]…
else if found). A brand-new epoch's firstout_httpsubscription hasfound == false, so a snapshot withoutout_httpproduces neither a resourcenor a removal.
respondDeltathen writes nothing:if len(resp.resources) > 0 || len(resp.removedResources) > 0 || (sub.IsWildcard() && request.ResponseNonce == "").RDS is not wildcard.
So the watch sits open and silent, Envoy's
out_httpinit target never fires,the listener warms out and activates with no route table. Confirmed in the
red test output below, where the whole RouteType map is
nil, not empty.What this changes
out_httpis emitted unconditionally (agent/internal/xds/cache/snapshot.go),exactly as the edge and capture route configs already are. This is the change
that actually closes the window: the subscription resolves on the first push.
BuildOutboundRouteConfiguration's on-demand catch-all makes the zero-vhosttable a working one rather than a silent 404 machine — liveness 200 on
MeshLivePath(the proposal 013 prober target lives only there),mesh-shaped authorities to their cluster via ODCDS, hard 404 for anything
foreign. fix(capture): on-demand catch-all + default mesh-DNS/capture on #288's capture catch-all is untouched;
BuildCaptureRouteConfigurationkeeps building it exactly as before.
initial_fetch_timeoutexplicitly.virtual_hostsslice instead ofappend-ing the catch-all onto the caller's backing array. Latent today(no current caller reuses the slice), but it is a one-line hazard in a
function whose whole job is to hand Envoy a table.
The
initial_fetch_timeoutvalue: 15 s, and whyinitial_fetch_timeoutis a fail-open bound, not a gate. When it expiresEnvoy activates the listener anyway, with whatever it has — which for a route
config that never arrived is nothing. No value of this field can prevent a
listener going active with an unresolved route table; it only decides how long
the control plane gets first. That is why item 1 above is the fix and this is
the pin.
buys is that the value becomes protocol-visible and assertable — today the
mesh's warming budget is an upstream default nothing in this repo mentions,
and an upstream default can drift under us.
registryReadyTimeout(server.go), the budgetPreListenspends before falling back to local-only. Anything shorter wouldlet a fresh Envoy epoch activate the egress listener while the agent that
feeds it is still inside its own initial-snapshot budget — reopening precisely
this 404 window. The two constants are now cross-referenced in comments and a
test asserts the 15 s value so they cannot drift apart silently.
epoch still serves), but on a cold proxy start there is no parent: extra
warming is extra time with no egress listener at all, and
listeners_warmingholds the pod un-Ready for it.
unable to publish would wedge the egress listener in warming for the life of
the process and the proxy would never report Ready — turning a degraded route
table into a total node data-plane outage. Fail-static on a stale table beats
fail-closed on no listener.
It is applied to the egress RDS only. The capture and edge route configs were
already emitted unconditionally, so their subscriptions resolve on the first
push and the timeout is not load-bearing for them; leaving them alone keeps the
diff to the resource this issue is about.
The negative-interval regime (LDS pushed after RDS)
The soak's TRIPLE showed w03 −2,393 ms and w04 −77,046 ms. Asked whether
that is harmless in general or only when an epoch survives to hold the cache:
It is harmless in general, and not for the reason the run's framing suggests.
Envoy's
RouteConfigProviderManagerImplkeys route-config providers by(route_config_name, config_source hash) and shares them across listeners. A
listener update that rebuilds the HCM re-uses the existing
out_httpprovider,whose
local_init_target_is already ready and whose last-delivered table isalready in hand — so the new listener does not warm on RDS at all and goes active
with routes immediately. The cache is provider-scoped, not epoch-scoped; a
listener re-push cannot invalidate it, which is what makes the ordering
irrelevant within a process.
The corollary is the important part: the negative regime and the failure regime
are structurally disjoint. Across an epoch boundary the provider manager starts
empty, so the interval is necessarily positive (subscription begins after the
listener is created) — that is the healthy 33–321 ms band. A negative interval
can therefore only ever be observed inside a surviving process, which is
exactly the case where the cached table is guaranteed to be there.
w04's 77 s is not a risk signal, it is a measurement of how long the agent was
absent (agent + proxy rolled concurrently: xDS socket gone, ADS stream broken,
update_timeonly advances on reconnect-and-push). During those 77 s Envoyserved fail-static from its cached config, which is correct xDS behaviour. Also
consistent with the observed agent-roll signature —
update_attemptrising whileupdate_successandconfig_reloadstay at 1 — which is just "the route configcontent did not change, so Envoy did not reload it".
Recommendation: no separate fix. But grading a negative RDS−LDS interval
against the positive healthy band is a category error, and the dashboard/runbook
framing should say so — it is a control-plane-absence measurement, not a
data-plane-risk one.
One residual I could not establish offline, and would not bundle here: the
provider is held by shared_ptr from the listeners referencing it, so on a node
that drains to zero meshed pods the egress listener (and with it the last
reference) goes away, and the next pod ADD re-subscribes cold — back in the
warming regime. There is no traffic in that window by construction, so it looks
benign, but I have not confirmed the teardown actually happens in the pinned
build. Worth its own issue if anyone wants it nailed down.
Verification
bazel test //agent/internal/xds/...and//test/envoy_validate:allpass;bazel test //...is green apart from//agent/internal/proxy/hotrestart:hotrestart_test,a pre-existing parallel-load flake (
errno=98binding the hot-restart domainsocket) that passes in isolation and is untouched by this change. Lint
(
--config=lint --@aspect_rules_lint//lint:fail_on_violation) andmake format-checkare clean.The red test, before the production fix
With
snapshot.goandfilterchain.goreverted tomainand the new tests inplace:
map[string]types.Resource(nil)rather than an empty map is the defect verbatim:the RouteType set is absent, not empty, which is what makes delta ADS answer with
silence.
test/envoy_validateIt can assert both, and now does:
initial_fetch_timeout:TestNodeBootstrapEgressRDSInitialFetchTimeoutre-parses the serialised node bootstrap — the same bytes
envoy --mode validateloads — walks to the HCM carrying
rds.route_config_name == out_httpandasserts the value. Parsing the serialised form rather than the in-memory
builder output is deliberate: a field lost in marshalling, or stripped
alongside the custom filters, would pass an in-memory check.
snapshot behaviour (that is the cache unit test's job), but it can prove the
zero-vhost table a real Envoy now has to load is accepted. New
outbound_zero_vhost_route_bootstrap.jsonscenario inlinesBuildOutboundRouteConfiguration(nil, meshDomain)as a staticroute_configand runs it through the pinned Envoy binary. Passing, alongside the six
existing scenarios:
No chart changes, so no
Chart.yamlbump.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Co-Authored-By: Claude Opus 5 [email protected]
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr