Skip to content

prober/mesh-dns: a mesh-dns roll drops the in-flight UDP query (SO_REUSEPORT close, no lame-duck) → 5 s resolv.conf retransmit + Go singleflight stall every lookup of that name → 16–31 prober 'timeout' misclassified as HTTP (dns_timeout was unreachable: probe budget 2 s < retransmit 5 s) #726

Closed

Description

@bpalermo

Observation (three occurrences, all on rev197+ builds)

when roll prober (node) path timeouts cluster.local path, same prober
2026-09-05 21:37–21:38Z (rev200 deploy) proxy DS roll, w02/w05 handoffs (not recorded) echo.aether-test.aether.internal:18081 31 in one scrape 0
2026-09-06 01:56Z (soak, roll #1) aether-mesh-dns roll prober on w05 aether.internal 19 0
2026-09-06 12:30–12:31Z (rev204 deploy) proxy DS roll; w01 (12:30:16Z) and w05 (12:30:46Z) new pods in that minute, w02 not yet (12:31:40Z) prober-sw777 on w02 aether.internal 16 0

Each prober drives 4.99 rq/s per path, so 16–31 timeouts is a 3–6 s full outage of that one path for that one prober. dns_timeout/dns_nxdomain/dns_error are zero every time — the DNS answer is fine; the HTTP request that follows it times out. Liveness (no DNS) is zero every time. The other rolls of the same kind produce zero (rev199/201/202/203 deploys: 2/0/0/0; soak mesh-dns rolls #2 and #3: 0/0), so it is not deterministic per roll.

Why it is worth an issue

It is the only data-plane blip left in the prober SLI (09-06 soak: 53 of 81 timeouts were rolls, and 46 of those 53 were these three-second bursts), and it discriminates between the two ways the prober reaches echo: the svc.cluster.local path (ClusterIP → capture → the node proxy's service cluster, EDS with two-phase drain #152) never loses a request during a roll, while the mesh-domain path (mesh-DNS answer → mesh port 18081 → the node proxy's :authority-named on-demand cluster) does. On 09-06 12:30Z the affected prober's own node had not rolled yet; the nodes mid-handoff were w01 and w05, and echo has a replica on w05. So the hypothesis is: the mesh-domain path pins the request to the pod IP the resolver returned (or to the FQDN-named cluster's endpoint set) without the DRAINING-aware endpoint health the service cluster gets, so requests keep going to the restarting node's inbound through the handoff window and time out.

Ask

  1. Confirm with the runbook join for one burst: access logs of the affected prober's node proxy for upstream_host and response_flags on the mesh-domain route during the burst minute (_stream:{service.name="aether-proxy"}, response_flags:"UT"/"UF" field syntax — control-test the negative), joined to which upstream pod/node it hit and whether that node was mid-handoff.
  2. If confirmed: make the FQDN-named on-demand cluster consume the same EDS health/DRAINING signal as the service cluster (or route the mesh-domain FQDN to the service cluster via auto_host_rewrite demux), so the two-phase drain covers both paths.
  3. Soak grading rule already records per-roll burst size; keep it until this is closed.

Refs: #152 (two-phase drain), #682 (ODCDS/TTL path), 09-06 run record, rev204 validation.

Activity

  1. bpalermo commented on Sep 6, 2026

    @bpalermo
    OwnerAuthor

    Phase 1 — the hypothesis is refuted. It is not the data plane at all: it is one lost DNS datagram in the mesh-DNS surge handoff, amplified 5x by the default resolver retransmit timeout.

    The requests that "timed out" never reached Envoy. There is no UT, no UF, no URX, no DC, no 503 — there is no access log for them at all. Both paths share one cluster, one EDS resource, one endpoint set, and one DRAINING signal, so nothing in #152/#682 territory can produce a one-path burst.

    a. The logs

    The burst is real and it is exactly one path. Raw counter (per-series deltas, not rate()), prober-sw777 on main-worker-02:

    target 12:30:30Z 12:31:00Z
    echo.aether-test.aether.internal:18081 17725 17741 (+16)
    echo.aether-test.svc.cluster.local:18081 18016 18016 (+0)

    The access log shows a hole, not a failure. log_name:"aether_access_logs" reporter:"source" pod_name:"prober-sw777" authority:"echo.aether-test.aether.internal:18081", 12:30:30–12:30:45Z: 54 records, complete (under the 100 cap), every one 200, response_flags:"-" — a steady 5.0/s from 12:30:30.072 to 12:30:40.841, and then nothing.

    The same query for …svc.cluster.local:18081 over 12:30:30–12:30:46Z returns 81 records, continuous at 5.06/s, no gap — 12:30:40.946, :41.084, :41.333, :41.636, :41.939, … :45.943. The cluster.local path kept flowing at full rate straight through the mesh-domain hole.

    Gap: 12:30:40.841Z → 12:30:45.947Z = 5.106 s.

    Fleet-wide negative control. Over 12:29:30–12:32:00Z there is not one non-200 source-reporter access log anywhere in the mesh. Control-tested both ways so this is not a false zero: response_flags:"UT" returns the k6 504s at 05:54:56Z, and NOT response_code:"200" returns a DC on w04 at 12:44:47Z. The syntax finds errors when errors exist. There were none.

    Both paths are the same data path. In the same seconds, for both authorities, downstream_local_address is 10.107.111.199:18081 (echo's ClusterIP), upstream_cluster is aether-test/echo, and upstream_host rotates over all three replicas — 10.244.0.225 (w04), 10.244.2.233 (w05), 10.244.4.36 (w02). No pinning, no per-path endpoint set, no skew. So the failing step is upstream of connect(), and the only step that is per-name is resolution.

    The trigger: mesh-DNS was rolling on w02, and the issue's timeline missed it

    aether-mesh-dns-h86kl on main-worker-02:

    12:30:39.383Z  warm-started mesh-DNS records from snapshot   generation=6 records=14
    12:30:39.478Z  mesh-DNS upstream defaulted from resolv.conf  upstreams=["10.96.0.10"]
    12:30:39.631Z  mesh-DNS ready-marker written
    12:30:39.632Z  mesh DNS resolver listening  addr=192.168.0.61:18054  reusePort=true
    

    The rev204 deploy rolled aether-mesh-dns too, not just the proxy. w02's resolver successor bound 1.2 s before the hole opens. The DaemonSet is maxSurge:1 / maxUnavailable:0, readiness is an exec probe with initialDelaySeconds:1, periodSeconds:15, and there is no preStop and no drain. So: successor binds at :39.63, its first readiness probe passes at ≈:40.6, the DS controller deletes the predecessor, kubelet SIGTERMs it, and Server.Start closes the SO_REUSEPORT UDP socket immediately (agent/internal/meshdns/server.go:493-497 — <-ctx.Done() → udp.Shutdown(); removeReadyMarker only runs after, as a defer). The hole opens at :40.841.

    While both sockets are in the reuseport group the kernel hashes each datagram to one of them. A datagram steered at the departing socket in the closing window is silently discarded. That is one lost query — the entire input to this bug.

    Why one lost datagram costs 5 seconds and 16 probes

    The prober's pod carries dnsConfig: options ndots:2 and nothing else — no timeout, no attempts — so the resolver uses the glibc/Go default timeout:5. That is the 5.106 s. And Go's resolver singleflights by name, so every subsequent probe for echo.aether-test.aether.internal piled onto the one stuck lookup while …svc.cluster.local, a different singleflight key, was never touched.

    The arithmetic closes exactly. Probes issued in the first ~3.1 s of the 5.1 s stall hit their own 2 s context deadline first: 3.1 × 4.99 ≈ 15.5 → 16 timeouts. Probes issued in the final 2.0 s were still waiting when resolution completed, and were released in a burst — visible in the log as three requests inside 1 ms at 12:30:45.947/.948/.948 and twelve inside 0.6 s, far above the 5/s tick.

    Why dns_* stayed zero — this is a real bug, and it is why three investigations blamed the data plane

    prober/internal/prober/prober.go:307:

    func classifyErr(ctx context.Context, err error) string {
    	if errors.Is(ctx.Err(), context.DeadlineExceeded) || errors.Is(err, context.DeadlineExceeded) {
    		return resultTimeout
    	}
    	// A DNS failure is checked before the generic net.Error timeout branch: a
    	// *net.DNSError also satisfies net.Error, and a resolution timeout must surface
    	// as dns_timeout (not the transport timeout) so the mesh-DNS signal is distinct.
    	var dnsErr *net.DNSError
    	...

    The comment states the intent; the code defeats it. The probe budget is 2 s and the resolver retransmit is 5 s, so ctx.Err() is always DeadlineExceeded before the *net.DNSError branch is ever reached. dns_timeout is structurally unreachable for exactly the failure mode it exists to catch. "dns_* zero" never meant DNS was healthy; it only meant DNS never failed fast.

    b. The xDS side — no asymmetry exists to exploit

    For completeness, since the issue proposes changing it:

    • echo.aether-test.aether.internal:18081 is an alias cluster. Its EdsClusterConfig.ServiceName is the bare aether-test/echo — the same ClusterLoadAssignment the portless service cluster uses (agent/internal/xds/cache/cluster.go:401-421, wired at agent/internal/xds/proxy/egress.go:216-222). Distinct cluster name, one EDS resource.
    • There is one endpoint producer for every mesh cluster, and buildHTTPEndpointBuckets appends the same *LbEndpoint pointer into the default CLA and every per-port bucket (cache/cluster.go:450-486). Health is stamped once at proxy/egress.go:620 from endpointHealthStatus (egress.go:631-656). HealthStatus_DRAINING therefore reaches every cluster shape by construction; it is not possible for one to miss it.
    • mesh-DNS returns the mesh Service's ClusterIP, never pod IPs (agent/internal/capture/reconciler.go:105-109, agent/internal/meshdns/server.go:655-662), which the access logs confirm. There is no pod pinning at the DNS layer.
    • There is no auto_host_rewrite in the repo at all; the demux is RouteAction_ClusterHeader{":authority"}.
    • And feat(agent): two-phase drain — DRAINING first, pool-close after delay #152 never engages here anyway: DRAINING is written only from handlePodTerminating on a workload pod deletion. Rolling aether-proxy deletes no echo pods.

    The aggregate kills the premise outright

    Largest single burst per prober per target over 24h:

    prober (node) svc.cluster.local aether.internal
    prober-5p56l (w01) 81 78
    prober-qqwvb (w03) 35 26
    prober-gz7gf (w05) 7 19
    prober-sw777 (w02) 7 16
    prober-5bt7w (w04) 9 1

    The biggest burst in the fleet is on the cluster.local path, and three of five probers have their worst burst there. Lifetime totals agree — every single prober has more cluster.local timeouts than mesh-domain ones (sw777 18016 vs 17741, qqwvb 19602 vs 18839, 5bt7w 19579 vs 18394, gz7gf 18218 vs 17588, 5p56l 23586 vs 22814).

    The mesh-domain path is not disadvantaged. Both names lose the coin flip at the same rate; whichever name's datagram happens to be in flight when the socket closes takes that roll's burst. The three samples in this issue caught the mesh side three times.

    c. The fix

    Not in the xDS cache. Two changes, both in aether:

    1. Bound the retransmit cost. Extend the pod-mutating webhook (controller/internal/podmutate) to inject options timeout:1 attempts:3 alongside the existing ndots. Against a node-local resolver a 1 s retransmit is generous; it turns a lost datagram from a 5 s per-name outage into a ~1 s hiccup, under the prober's 2 s budget and under essentially any client's. Worst-case total resolution is 3 s vs 10 s today, so resilience improves in both directions. This is fail-open (a resolv.conf option), it covers every managed pod rather than the prober, and it fixes the symmetric cluster.local bursts too — including the 81-timeout one on w01. ndots is derived from --mesh-domain rather than flagged, so this follows the same shape and needs no chart change.

    2. Make the class observable. Reorder classifyErr so the *net.DNSError branch is tested before the context-deadline branch, as its own comment already prescribes. A resolution stall then records dns_timeout instead of timeout, and this failure mode stops masquerading as a data-plane defect.

    Deliberately not doing, and worth a separate issue: eliminating the datagram loss itself. A post-SIGTERM lame-duck window in Server.Start (drop the ready marker first, keep serving briefly, then close) would narrow the window, but the drop is a kernel reuseport-group race at socket close and cannot be fully closed from userspace without eBPF socket steering. Bounding the client's retransmit is what actually removes the user-visible outage; narrowing the window is a second-order improvement.

    Grading note: the per-roll burst rule should stay, but it should be graded per path together, not as a mesh-domain-specific signal.

  2. changed the title [-]prober: mesh-domain path takes a 16–31 timeout burst (~3–6 s at 5 rq/s) on ~1 in 3 proxy/mesh-dns rolls; the cluster.local path on the same prober is untouched[/-] [+]prober/mesh-dns: a mesh-dns roll drops the in-flight UDP query (SO_REUSEPORT close, no lame-duck) → 5 s resolv.conf retransmit + Go singleflight stall every lookup of that name → 16–31 prober 'timeout' misclassified as HTTP (dns_timeout was unreachable: probe budget 2 s < retransmit 5 s)[/+] on Sep 6, 2026
  3. bpalermo commented on Sep 6, 2026

    @bpalermo
    OwnerAuthor

    Phase 2 — validation of #728 on talos-main: PASS

    10 × aether-mesh-dns DaemonSet rolls under steady prober load, rev205 / chart 0.92.6-bcf2352, prober chart 0.2.0-bcf2352. Window 13:17:50Z → 13:52:41Z, 2026-09-06. No k6 — prober-only load (5 rq/s per path per prober, 5 probers), which is the load level at which the pre-fix bursts occurred.

    Pre-flight

    All five prober pods carry the injected options (the webhook is CREATE-only, so this was the thing most likely to invalidate the run):

    prober-bdzqk main-worker-01 {"options":[{"name":"ndots","value":"2"},{"name":"timeout","value":"1"},{"name":"attempts","value":"3"}]}
    prober-spjkx main-worker-02 (same)   prober-xb585 main-worker-03 (same)
    prober-lz5ts main-worker-04 (same)   prober-gsj2l main-worker-05 (same)
    

    Restarts 0 fleet-wide, no taints, mesh-dns 5/5 Ready, aether_mesh_dns_ready/watch_active = 1 and records = 14 on all five nodes (14, not 15 — matches the records=14 in the Phase-1 log).

    The deployed prober binary really does carry the reorder — checked against the merged tree, not assumed (git show bcf2352:prober/internal/prober/prober.go): classifyErr tests *net.DNSError first, ctx.Err() second.

    Per-roll results

    Raw per-series counter deltas between consecutive reads (not rate(), not increase()), 120 s settle after each convergence. node on prober metrics is the prober pod name; mapped to k8s nodes via kubectl.

    roll window (UTC) mesh-dns roll order timeout / dns_timeout / other, per prober per path
    1 13:19:13→13:20:16 w2>w5>w1>w3>w4 all zero
    2 13:22:33→13:24:04 w5>w2>w4>w1>w3 all zero
    3 13:26:04→13:27:34 w1>w4>w5>w3>w2 all zero
    4 13:29:47→13:30:22 w4>w1>w2>w5>w3 all zero
    5 13:32:22→13:33:27 w4>w3>w1>w5>w2 all zero
    6 13:35:35→13:36:25 w1>w2>w3>w5>w4 all zero
    7 13:38:25→13:39:00 w4>w5>w2>w3>w1 all zero
    8 13:41:08→13:42:26 w5>w2>w1>w3>w4 prober-lz5ts (w04), aether.internal: 2 connection_error
    9 13:44:26→13:45:30 w3>w1>w5>w2>w4 all zero
    10 13:47:41→13:48:30 w3>w4>w5>w1>w2 all zero

    "all zero" = 0 for every one of timeout, dns_timeout, dns_error, dns_nxdomain, connection_error, http_error, on both paths, on all five probers.

    Totals over the 10 rolls

    quantity value
    timeout, both paths, all probers 0
    dns_timeout / dns_error / dns_nxdomain, both paths 0 / 0 / 0
    http_error, both paths 0
    connection_error 2 (prober-lz5ts, mesh-domain, roll 8)
    largest single-roll burst, aether.internal 2 (and it is not a DNS class)
    largest single-roll burst, svc.cluster.local 0
    rolls with any burst ≥3 0
    liveness non-success 0 / 52,452 probes
    successful mesh_dns probes 104,932
    mesh-dns restarts 0 (5/5 Ready at end)
    agent ERROR lines 0 (control-tested: 7,495 log lines read, WARNs surfaced)
    collector refused / send_failed / receiver_failed, in-window 0 / 0 / 0 (RSS 246 MiB of 2 Gi)
    alerts fired in #alerts during the window none (newest message 11:47:55Z, before the window; only the dead-man's-switch heartbeat is firing)

    Pass criterion was ≤2 per path per prober per roll with liveness 0. Met with room to spare: the worst cell in the entire run is 2, and those two are connection_error — a post-resolution connect failure, a different class from anything #726 is about. Both landed on the prober co-located with the last node in roll 8's order (w04 mesh-dns started 13:42:23, prober-lz5ts is on w04), so they are roll-adjacent, but 2 events is at the noise floor and no DNS class moved with them.

    Against the pre-fix baseline in the Phase-1 comment — 16–31 timeout on one prober's mesh-domain path, roughly 1 roll in 3 — the probability of seeing zero bursts across 10 rolls had nothing changed is (2/3)^10 ≈ 1.7%.

    What this run does NOT show, and it matters for #729

    I tried to confirm the second half of the model — that the hole still opens but is now ~1 s and therefore absorbed inside the prober's 2 s budget — and the measurement is not available. aether_probe_request_duration_seconds cannot resolve it:

    record() passes time.Since(start).Seconds()      # value in SECONDS
    histogram boundaries are 5,10,25,...,10000       # OTel default explicit buckets (ms-oriented)
    

    So the first bucket is "≤ 5 seconds", and every probe under the 2 s deadline falls into it. Control-tested against a known pre-fix burst: on prober-5bt7w at 11:50Z, all 18,394 timeout observations — each of which took ~2 s by construction — sit in le=5, identical to +Inf. A histogram in which a 2 s timeout and a 2 ms success share the first bucket has no resolving power here.

    Consequence: this run confirms the user-visible outage is gone, which is what #728 set out to do, but it does not measure the residual datagram-loss window that #729 exists to close, and it cannot distinguish "the hole occurred and was absorbed" from "the hole did not occur in these 10 rolls". #729 will need either the access-log gap method used in Phase 1, or usable bucket boundaries on that histogram, to show a before/after.

    That bucket/unit mismatch looks worth its own issue regardless — it silently flattens every prober latency panel and any p99 built on them.

    Leaving #726 open as requested. Cluster left as found: mesh-dns 5/5 Ready, nothing else rolled.

  4. bpalermo commented on Sep 6, 2026

    @bpalermo
    OwnerAuthor

    Closed by #728's merge; the 10-roll validation above confirms the user-visible outage is gone (timeout 0, dns_timeout 0, worst cell 2 connection_error; pre-fix 16–31 on ~1 roll in 3, P(zero in 10 | unchanged) ≈ 1.7%). The datagram loss itself, now a ≤1 s hole absorbed by timeout:1 attempts:3, is tracked in #729; measuring that residual needs the access-log gap method or the histogram fix in #732, because the prober's duration histogram cannot see sub-5-second values today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions