[2.3] fix: revert per-client xDS readiness gates in favor of a fir…#14387
Merged
davidjumani merged 2 commits intoJul 10, 2026
Merged
Conversation
…st-connect grace period (kgateway-dev#14380) # Description Backport of kgateway-dev#14380 (commit `714190cf85dcd8c06849f819053249ab8e0efbe7` on `main`) to `v2.3.x`. Part of kgateway-dev#14184. This is **not** a clean cherry-pick. The functional changes are byte-for-byte the main commit; the only adaptations reconcile branch divergence: - `pkg/kgateway/proxy_syncer/perclient_test.go` — retargeted to `v2.3.x`'s older `ir.UniqlyConnectedClient` / `ir.NewUniqlyConnectedClient` spelling (`main` renamed these to `Uniquely…`). The `NewUniquelyConnectedClients` collection constructor is spelled the same on both branches and was left untouched. - `.github/workflows/e2e.yaml` — appended `XdsStarvation` to `cluster-seven`'s existing run regex (which on `v2.3.x` already carries an extra `AttachedRoutes` entry) rather than replacing the line. - `Makefile` — same `grep` -> `grep -x` fix in `kind-create`, re-anchored to a different line number. No behavioral differences from the `main` commit. # Change Type /kind fix # Changelog ```release-note Reverted the per-client xDS whole-snapshot readiness gates, which could withhold a gateway's configuration indefinitely when it referenced a backend that can never become ready (for example an ExternalName Service) — stranding already-connected proxies on stale endpoints and crash-looping newly started proxy pods. Readiness is now handled by a bounded per-stream first-connect grace period (configurable via KGW_XDS_FIRST_CONNECT_DELAY, defaulting to 1s). ``` # Additional Notes Signed-off-by: David L. Chandler <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Backports the main fix to v2.3.x that removes per-client whole-snapshot xDS “readiness gates” (which could indefinitely withhold config) and replaces them with a bounded per-stream first-connect grace period, plus regression coverage (unit + e2e) for the starvation scenarios.
Changes:
- Replace per-client snapshot gating with a per-stream first-connect delay (env-tunable) to reduce reconnect-time partial-snapshot races without risking indefinite starvation.
- Add unit tests pinning the delay contract and add a new e2e suite (
XdsStarvation) covering ExternalName/never-ready backend reference scenarios. - Minor CI/tooling updates: extend e2e run regex, and tighten KinD cluster existence check (
grep -x).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/tests/kgateway_tests.go | Registers the new XdsStarvation e2e suite in the kube gateway runner. |
| test/e2e/features/xds_starvation/testdata/setup.yaml | Manifests for the starvation scenario (ExternalName backend + valid backend + ReferenceGrant). |
| test/e2e/features/xds_starvation/testdata/postrestart-route.yaml | Route applied post-controller-restart to validate warm-client update flow. |
| test/e2e/features/xds_starvation/suite.go | New e2e suite asserting anti-starvation properties across serving, proxy rollout, and controller restart. |
| pkg/krtcollections/uniqueclients.go | Implements the per-stream first-connect delay (lazy env read + atomic storage) and sleeps only on new streams. |
| pkg/krtcollections/uniqueclients_test.go | Disables the first-connect delay for existing unique-clients tests to avoid test slowdown. |
| pkg/krtcollections/uniqueclients_delay_test.go | Adds a focused contract test for the first-connect delay behavior. |
| pkg/krtcollections/export_test.go | Exposes a test-only helper to override/restore the delay atomically. |
| pkg/kgateway/setup/main_test.go | Sets KGW_XDS_FIRST_CONNECT_DELAY=0 for in-process ADS setup tests (unless overridden). |
| pkg/kgateway/proxy_syncer/proxy_syncer.go | Removes referenced-cluster tracking and updates Delete/no-op commentary. |
| pkg/kgateway/proxy_syncer/perclient.go | Removes readiness gates and relies on per-stream delay + minimal “inputs not ready” deferral. |
| pkg/kgateway/proxy_syncer/perclient_test.go | Removes readiness-gate tests and keeps/adjusts anti-starvation tests (errored clusters, blackhole backend refs). |
| Makefile | Fixes KinD cluster-existence guard to avoid substring matches (grep -x). |
| .github/workflows/e2e.yaml | Adds XdsStarvation to cluster-seven’s e2e run regex. |
Signed-off-by: David L. Chandler <[email protected]>
davidjumani
approved these changes
Jul 10, 2026
Merged
via the queue into
kgateway-dev:v2.3.x
with commit Jul 10, 2026
1b63106
31 of 32 checks passed
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.
…st-connect grace period (#14380)
Description
Backport of #14380 (commit
714190cf85dcd8c06849f819053249ab8e0efbe7onmain) tov2.3.x. Part of #14184.This is not a clean cherry-pick. The functional changes are byte-for-byte the main commit; the only adaptations reconcile branch divergence:
pkg/kgateway/proxy_syncer/perclient_test.go— retargeted tov2.3.x's olderir.UniqlyConnectedClient/ir.NewUniqlyConnectedClientspelling (mainrenamed these toUniquely…). TheNewUniquelyConnectedClientscollection constructor is spelled the same on both branches and was left untouched..github/workflows/e2e.yaml— appendedXdsStarvationtocluster-seven's existing run regex (which onv2.3.xalready carries an extraAttachedRoutesentry) rather than replacing the line.Makefile— samegrep->grep -xfix inkind-create, re-anchored to a different line number.No behavioral differences from the
maincommit.Change Type
/kind fix
Changelog
Additional Notes