Repository navigation
net: scope worker gateway topology watches - #918
Open
Patrick W. Healy (phealy) wants to merge 19 commits into
Open
Patrick W. Healy (phealy) wants to merge 19 commits into
Patrick W. Healy (phealy) wants to merge 19 commits into
Conversation
Patrick W. Healy (phealy)
added this pull request to stack #919
October 14, 2026 23:10
This was referenced Oct 14, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved startup concurrency, blocked reconciliation, MTU calculation, and status consistency issues prevent approval.
6 open findings
MTU resolver omits site, assignment, and downstream pool caps · New Pool matching applies MTU caps from non-traversed peering edges · New Data race on shared startup error variable · New Gateway MTU replaces instead of minimizing downstream cap · New Blocked cache sync prevents obsolete worker starts from being canceled · New Route summary uses stale gateway pool informer instead of lifecycle snapshot · New
What changed in this PR
Reduces node-agent API server load by running gateway topology watches only when needed, completing the five-PR optimization stack.
Changes:
- Adds gateway informer lifecycle management, synchronized callbacks, and readiness reporting.
- Calculates MTU limits from forwarding paths rather than connected topology.
- Doubles informer watch timeouts and adds tests and documentation.
| File | Description |
|---|---|
| docs/net/configuration.md | Documents forwarding-path MTU limits. |
| docs/net/architecture.md | Explains conditional gateway watches. |
| docs/content/reference/networking/configuration.md | Updates public MTU guidance. |
| cmd/unbounded-net-node/status_server.go | Adds lifecycle-aware readiness and status. |
| cmd/unbounded-net-node/status_server_http_test.go | Tests gateway readiness responses. |
| cmd/unbounded-net-node/site_watch_reconcile.go | Integrates informer lifecycle and transit MTUs. |
| cmd/unbounded-net-node/reconciliation_helpers.go | Adds forwarding-path MTU calculations. |
| cmd/unbounded-net-node/reconciliation_helpers_test.go | Tests revised MTU behavior. |
| cmd/unbounded-net-node/node_types.go | Carries transit MTU limits. |
| cmd/unbounded-net-node/mtu.go | Applies role-aware assignment limits. |
| cmd/unbounded-net-node/main.go | Separates discovery and gateway informers. |
| cmd/unbounded-net-node/informer_factory.go | Doubles watch timeouts. |
| cmd/unbounded-net-node/informer_factory_test.go | Tests watch and LIST options. |
| cmd/unbounded-net-node/gateway_informer_lifecycle.go | Manages conditional gateway caches. |
| cmd/unbounded-net-node/gateway_informer_lifecycle_test.go | Tests lifecycle transitions and callbacks. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Patrick W. Healy (phealy)
force-pushed
the
phealy/net-api-worker-watches
branch
from
October 16, 2026 13:37
004a5b8 to
0e89e14
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Gateway-side MTU resolution still omits local pool and same-Site assignment limits.
2 open findings
6 resolved since last review
Gateway MTU replaces instead of minimizing downstream cap Data race on shared startup error variable Pool matching applies MTU caps from non-traversed peering edges MTU resolver omits site, assignment, and downstream pool caps Route summary uses stale gateway pool informer instead of lifecycle snapshot Blocked cache sync prevents obsolete worker starts from being canceled
🧠 Review effort: Balanced
Patrick W. Healy (phealy)
force-pushed
the
phealy/net-api-worker-watches
branch
from
October 16, 2026 14:03
0e89e14 to
0cebb37
Compare
Patrick W. Healy (phealy)
force-pushed
the
phealy/net-api-worker-watches
branch
from
October 16, 2026 14:18
0cebb37 to
3dc157b
Compare
Patrick W. Healy (phealy)
force-pushed
the
phealy/net-api-worker-watches
branch
from
October 16, 2026 14:32
3dc157b to
3327ee5
Compare
Patrick W. Healy (phealy)
force-pushed
the
phealy/net-api-worker-watches
branch
from
October 16, 2026 14:55
3327ee5 to
8f048de
Compare
Patrick W. Healy (phealy)
force-pushed
the
phealy/net-api-worker-watches
branch
2 times, most recently
from
October 23, 2026 21:02
c6fd7c2 to
f4c85db
Compare
Cameron Childress (cchildress)
previously approved these changes
Oct 23, 2026
Patrick W. Healy (phealy)
enabled stacked auto-merge
October 23, 2026 22:40
hbc (bcho)
approved these changes
Oct 23, 2026
Patrick W. Healy (phealy)
disabled stacked auto-merge
October 23, 2026 23:31
github-merge-queue
Bot
removed this pull request from the merge queue because a pull request earlier in the stack was removed
Oct 23, 2026
Use forwarding paths rather than undirected topology components for MTU resolution, and dynamically synchronize gateway-specific informers only while the pinned role or direct Site assignments require them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Wrap dynamic watch requests so reflector-selected randomized timeouts are doubled for both watch-list initialization and normal watches without changing LIST requests or other watch options. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Keep SiteGatewayPoolAssignment MTUs off ordinary worker mesh links while retaining them for gateway-to-assigned-Site forwarding paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Install the update callback once before launching the reconcile worker and dispatch lifecycle events through a synchronized callback lookup. Cover late callback registration with immediate add, update, and delete events for all three gateway resources. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Cancel obsolete unsynced generations, bound required-cache synchronization, preserve adjacent-hop MTU caps, and use the active generation in route summaries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Apply local pool caps to gateway-facing peers and fabric MTU without including unrelated pools, and preserve assignment caps for same-Site gateway-to-worker links. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Include the next-hop gateway Site and downstream gateway mesh-edge caps while separating worker assignments from gateway-local pool assignments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Propagate link, route and policy teardown errors without forgetting failed interface cleanup. Index assignment MTUs once and exclude local routes before calculating transit caps. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Skip route destinations without GatewayPoolNode objects. Index SitePeering MTUs and retain discovered policy tables until cleanup succeeds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Advertise the verified local forwarding limit after successful dataplane work. Apply published gateway and intermediate-pool limits on workers only to avoid gateway feedback. Preserve pending policy setup across failed teardown, reinstallation, and expected-interface reconciliation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Bypass unchanged-state reconciliation after a partial programming failure, and propagate gateway policy installation errors. Index enabled pool-peering MTU caps once per reconcile. Avoid synchronous assignment-cache scans for unchanged resyncs and events unrelated to the adopted Site, preserving immediate local dependency cancellation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Compute a common configured Site and mesh-peering MTU cap from existing caches. Shared pod-facing and tunnel interfaces require this constraint even without transitive routing. Exclude disabled, network-only, missing-Site and disconnected relationships; do not join components through gateway paths. Apply the cap to peers and the local fabric without adding API writes or watches, and cover the three-Site asymmetric case and upward recovery. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Replace eager all-pairs expansion with linear Site and GatewayPool memberships and memoized lookups for pairs actually used by accepted gateway paths. Build gateway-only indexes lazily so direct-mesh workers do not pay for them. Cover 1,000-member peerings and repeated reverse-pair cache hits without quadratic storage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Retain the attempted fabric MTU independently from committed routing state and retry CNI/pod MTU writes after any incomplete reconciliation. Mark all error exits dirty, including unchanged-state verification failures. Preserve tighten-before-tunnel and tunnel-before-relax ordering through failed writes and topology reversions. Extend production-path tests for failed status publication, partial pod MTU updates, verification drift, and both reversion directions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab9b78ee-42b8-4841-8d74-cd78d002d48b
Use an empty netlink cache so policy-cap assertions do not inherit the host default-route MTU. Preserve the production underlay cap behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 46ff6261-c4cc-4fb0-9fb7-4e66d2b9c203
Retain advertised gateway objects for unmanaged Site coverage and dataplane retry assertions for neighbor sizing failures that were previously recorded in merge resolutions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 46ff6261-c4cc-4fb0-9fb7-4e66d2b9c203
Avoid a second zero-length socket write after an empty protobuf frame has already been consumed and the peer has closed. Cover immediate peer closure for empty and nonempty requests and preserve write-error propagation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 46ff6261-c4cc-4fb0-9fb7-4e66d2b9c203
Patrick W. Healy (phealy)
force-pushed
the
phealy/net-api-worker-watches
branch
from
October 23, 2026 23:47
2dc101f to
21c4dfb
Compare
This branch has not been deployed
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.


Summary
Stop worker agents from watching cluster-wide gateway topology they don't use.
Testing
Stack
This is one of five stacked PRs that reduce API server load from unbounded-net-controller and unbounded-net-node. Kubernetes remains the source of truth. Review them bottom to top:
Motivation. A large cluster running v0.8.0 had the controller continuously writing objects that hadn't changed. Every node agent also watched the whole cluster's gateway topology. On a canary cluster, the full stack cut controller API calls by 54.4% and node agent API calls by 73.8%.