Skip to content

quic: a pruned on-demand twin is stranded if its source ServiceAccount returns to the node — Envoy never re-requests a subscribed ODCDS name (503 NC forever) #1036

Closed

Description

@bpalermo

Finding (from #1035's live gate)

Envoy's ODCDS manager (XdstpOdcdsSubscriptionsManager, od_cds_api_impl.cc) keeps one singleton subscription per cluster name for the life of the proxy process. When the server removes a cluster that was fetched on demand, Envoy drops the cluster and keeps the subscription. Every later on-demand request for that name logs ODCDS-manager: resource … is already subscribed to, skipping and sends nothing. The request 503s NC at the 2 s on_demand timeout, and so does every request after it, until the proxy restarts. //test/mtlspool TestOnDemandQUICSubscribedTwinsServedAfterAgentRestart/strand_control shows this: status=503 … in 2.000384001s, and no CDS request reaches the control plane.

#1035 handles this for agent restarts: re-subscribed twins are served. #1032's removal-evidence pruning (pruneQUICPairsLocked) has the same exposure, and it is not fixed:

  1. A pair's twin was fetched on demand, so the proxy holds a live subscription for it.
  2. The source ServiceAccount's last pod leaves the node, so the pair and its twin are pruned. The subscription stays.
  3. A pod of the same ServiceAccount is scheduled on the node again while the proxy lives. The arm names the twin again, the request routes to it, Envoy skips the fetch, and it 503s at the timeout, forever.

A destination that is delisted and then re-listed has the same exposure.

This is inferred from the mechanism; the source-return sequence was not reproduced separately.

Ask

  • Add a live repro in //test/mtlspool: fetch the twin, prune it, return the source, request.
  • Candidate fix: the agent tracks the twin names the proxy holds a live on-demand subscription for, on the current stream (first-use and re-subscribed names), and re-admits such a pair when it becomes valid again.

Related: #1020, #1032, #1033, #1035.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions