Skip to content

fix(agent): drop waypointed endpoints from the UDP load assignment - #939

Merged
bpalermo merged 1 commit into
mainfrom
fix/udp-load-assignment-waypoint
Sep 26, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/udp-load-assignment-waypoint

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Fixes #932.

UDPLoadAssignment clone-and-patched the service's shared bare-name load assignment, rewriting exactly two fields (protocol, port) and carrying everything else through proto.Clone. For a waypointed endpoint that is wrong in a way the rewrite cannot fix.

src's address for a remote-cluster endpoint is not the pod. The HTTP path rewrote it to the destination node's IP plus the east/west tunnel port (proposal 019) and marked it with waypoint subset metadata. Rewriting only the port left the node IP in place, so the datagram went to a host that was never the backend — silently, because the UDP floor has no transport socket and nothing asserts the reply.

Why drop rather than fix the address

There is no correct address to substitute. The tunnel is a TCP mTLS SNI forwarder with no datagram counterpart, so a waypointed backend is genuinely unreachable over the UDP floor.

Dropping makes that legible: the service ends up with no routable endpoint, which is exactly what udp_no_healthy_backend counts and logs (#937). So a waypoint-only service now reports itself instead of delivering to the wrong machine — the two fixes compose.

Two other fields stop surviving

field why
Metadata the udp: cluster sets no LbSubsetConfig, so an envoy.lb subset key is inert — and an inert subset key on a cluster that does no subset LB invites someone to think it is load bearing
HealthCheckConfig it opts an endpoint out of an active health check, and this cluster has none, so it describes a mechanism that does not exist here

Priority is flattened to 0: without the locality-priority set the HTTP path builds, a lone endpoint left at a non-zero priority is a cluster whose only host sits in an empty fallback tier, which Envoy will not use.

What deliberately still survives

HealthStatus. Before #936 it was meaningless here — a TCP probe of a UDP port could only ever fail, which was #931. Now the probe targets the mesh inbound port, which a UDP pod really does answer, so the verdict is a real signal and should propagate.

Tests

Both directions, plus one thing the old code got away with: the tests assert src is not mutated. It is the shared bare-name assignment; the old code patched the clone, but the next reader of that habit might not.

bazel test //... — 109/109. Lint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Fixes #932.

UDPLoadAssignment clone-and-patched the service's SHARED bare-name load
assignment, rewriting exactly two fields (protocol, port) and carrying everything
else through proto.Clone. For a waypointed endpoint that is wrong in a way the
rewrite cannot fix.

src's address for a remote-cluster endpoint is not the pod. The HTTP path
rewrote it to the destination NODE's IP plus the east/west tunnel port (proposal
019) and marked it with waypoint subset metadata. Rewriting only the PORT left
the node IP in place, so the datagram went to a host that was never the backend
-- silently, because the UDP floor has no transport socket and nothing asserts
the reply.

There is no correct address to substitute. The tunnel is a TCP mTLS SNI
forwarder with no datagram counterpart, so a waypointed backend is genuinely
unreachable over the UDP floor. So drop it, which makes the state legible: the
service ends up with no routable endpoint, and that is exactly what
udp_no_healthy_backend counts and logs (#931). A service reachable ONLY through
the waypoint therefore reports itself instead of delivering to the wrong machine.

Two other fields stop surviving the clone:

  Metadata           the udp: cluster sets no LbSubsetConfig, so an envoy.lb
                     subset key is inert -- and an inert subset key on a cluster
                     that does no subset LB invites someone to think it is load
                     bearing.
  HealthCheckConfig  it opts an endpoint out of an ACTIVE health check, and this
                     cluster has none, so it describes a mechanism that does not
                     exist here.

Priority is flattened to 0: without the locality-priority set the HTTP path
builds, a lone endpoint left at a non-zero priority is a cluster whose only host
sits in an empty fallback tier, which Envoy will not use.

HealthStatus DOES still survive, and that is deliberate. Before #936 it was
meaningless here (a TCP probe of a UDP port could only ever fail); now the probe
targets the mesh inbound port, which a UDP pod really does answer, so the verdict
is a real signal.

The tests also pin that src is not mutated -- it is the shared assignment, and
the old code patched the clone but the next reader of that habit might not.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit c42962c into main Sep 26, 2026
23 checks passed
@bpalermo
bpalermo deleted the fix/udp-load-assignment-waypoint branch September 26, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant