Skip to content

agent: a restart leaves the node's proxy on stale xDS for ~15 s (pod replacement ~9 s + start-to-first-serve ~7 s) #1123

Closed

Description

@bpalermo

Split out of #1103 (closed by #1122 for the client-visible failures). Measured on talos main-worker-04, 2026-10-01 TRIPLE roll: old agent stopped 05:41:24.45, new agent container started 05:41:33.16, served xDS at 05:41:39.93 — 15.5 s during which the node's proxy has no ADS stream and routes on whatever it last heard (drain marks, endpoint removals, new twins and LDS changes all wait). #1118 made the proxy reconnect within 1 s of the agent serving again and #1122/#1101/#1113 bound the damage to in-flight requests, but the gap itself is unchanged; kind showed 6–16 s.

Two terms to attack separately:

  1. Pod replacement (~9 s): the agent DaemonSet rolls delete-then-create. Options: surge with a socket handoff (the agent owns host-path UDS sockets for xDS and CNI, so a surge pod needs the listener handed over or a second socket path the proxy/CNI fail over to), or pre-pulled image + faster termination.
  2. Start to first serve (~7 s): registry load, SPIRE certificate wait (bounded 5 s since fix(xds): a restarted agent's proxy hears drain marks within 1 s of the agent serving, without dropping its quic: twins; cross-replica drain marks skip the write-behind tick (#1103) #1118), capture projection gate (bounded 10 s since fix(capture): a mesh-Service re-projection no longer strips the declared-port TCP chains, and the first serve waits for the projection (#1094) #1099). Profile a cold start and remove what is serial without need.

Gate: p99 time without an ADS stream across an agent roll, measured from the proxy's side (control_plane.connected_state or the ADS stream log lines), < 5 s on talos; no regression in #1085/#1099/#1118's first-serve gates.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Activity

  1. bpalermo commented on Oct 2, 2026

    @bpalermo
    OwnerAuthor

    Folded in from #1129 (closed): in the 2026-10-02 soak's TRIPLE on main-worker-05 the agent restarted inside the node's proxy handoff (old agent's last line 06:54:18.4, new one's first 06:54:25.4, ADS down ~15 s) and the successor logged an SDS Secret initial fetch timed out at 06:54:34.34. No request failed, but this is the visible cost of the gap: per-resource fetches (SDS/RDS/EDS) keep their 15 s timeouts by design, so a restart gap at or above that lets a successor proceed with a resource missing. Bringing the gap well under 15 s (target < 5 s) removes it.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

  2. bpalermo commented on Oct 3, 2026

    @bpalermo
    OwnerAuthor

    Data point from the 2026-10-03 nightly soak (nightly-1003/2.2.3-222af5d, 2 Envoy workers; #1093 closed on it): the only non-success probes of the run — 14 mesh_dns timeouts (Get …: context deadline exceeded, elapsed 2,000–2,368 ms), all on main-worker-05 at 06:53:35–38Z — fell exactly in this issue's gap.

    The TRIPLE churn step restarts proxy + agent + svc-3 together. On w05 the proxy's child forked at 06:53:16.7, the parent drained at 06:53:21.5 and exited at 06:53:36.86; the agent's ADS stream dropped at ~06:53:33.4 (Envoy: DeltaAggregatedResources … closed since 1s ago at 06:53:34.45) and the replacement agent pod logged first at 06:53:39.33 (container start 06:53:41Z). The failed probes started at ~06:53:33.5–36.3 — the ~6 s with no agent serving xDS, overlapping the parent's final seconds on the node with the run's largest stall bracket (27.8k starved ms). Six of the 14 have a source-side 0 DC access-log row to the echo endpoint; rows for the other 8 were not found (likely lost with the exiting parent's logs — unverified).

    Same shape as the 10-02 run's F3 observation (there with an SDS initial fetch timed out that did not recur this time). So the remaining soak residual is this issue's window, not CPU starvation: once #1142-era changes halve the gap further or proposal 041 lands, the TRIPLE on the hottest node is the check.

  3. bpalermo commented on Oct 5, 2026

    @bpalermo
    OwnerAuthor

    Proposal 041 proven on talos-main — 8 h soak nightly-1005-surge/2.4.5-c6dacde (2026-10-05, surge on, maxSurge 1 / maxUnavailable 0).

    • 10 agent takeovers (5 nodes × the agent roll and the TRIPLE): every one ran two agent pods on the node (another agent owns this node; starting as a standby → node lock acquired → this agent owns the node).
    • Proxy-side gap, old agent's last log line → first CDS response on the new stream (an upper bound, includes snapshot delivery): median 0.44 s, max 0.83 s; lock → CDS median 0.31 s. control_plane.connected_state (5 s scrape) caught a single 0 sample (w05, TRIPLE).
    • 0 prober failures in either agent-roll bracket; mesh_dns timeouts in the w05 TRIPLE: 0 (10-03 had 14 there). Liveness 0/719,987, k6 0/9,179,875.
    • 0 agent restarts / OOMKills (10-04 had 3 at the 64Mi limit); agent Go memory peak 59 MiB of 128Mi.
    • Agent roll of the fleet: 28–33 s.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

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