Repository navigation
feat(agent): register and promote under every protocol key (037 Phase 2, Release B part 2) - #893
Merged
Merged
Conversation
… 2, Release B part 2)
A pod that serves both an HTTP and a raw-TCP port must appear in BOTH registry
listings. Part 1 taught the endpoint to carry per-port protocols; this makes
the key set follow.
NewServiceEndpointFromCNIPod now returns the SET of keys a pod belongs under,
derived from port_protocols rather than from the pod-level annotation. Every
pod written before proposal 037 holds exactly one key -- an unsuffixed port
inherits the pod-level endpoint.aether.io/protocol -- so the slice is
one-element and all four call sites behave exactly as before.
All four follow: registration (pod.go), drain-marking and the delayed pool
close (termination.go), health promotion (liveness.go) and the ghost sweep
(ghostsweep.go). They share one helper, registerUnderAll, so the semantics are
stated once rather than four times.
Two properties that helper guarantees, both load-bearing:
- It does not stop at the first error. One key failing must not skip the
others: the rest can still be brought up to date and the retry has less
to do.
- It reports a PARTIAL failure as a failure. This is 037 Risk 5. A registry
does not reject a half-written dual-protocol pod, so nothing but this
return value separates "both keys updated" from "one updated, the other
silently stale". The promotion path is where that turns permanent: it
records the transition on success, and the next tick then sees prev ==
want and never retries -- the other listing's endpoint stays UNHEALTHY
forever, with no error anywhere and a cluster that merely looks empty of
pods.
Callers pass ONE deadline covering all writes, never one per key: several of
these run with lifecycleMu held (S20, #772), where a per-key timeout would let
a dual-protocol pod multiply the worst-case lock hold that bound exists to cap.
Negative control: with the helper writing only the first key -- which is both
the pre-037 behaviour and the exact shape of Risk 5 -- the two dual-key
subtests fail and the single-protocol subtest still passes, since that path is
unchanged.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
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.
Proposal 037 Phase 2, Release B part 2. Follows #892 (part 1, merged).
A pod serving both an HTTP and a raw-TCP port must appear in both registry listings. Part 1 taught the endpoint to carry per-port protocols; this makes the key set follow.
What changed
NewServiceEndpointFromCNIPodnow returns the set of keys a pod belongs under, derived fromport_protocolsrather than from the pod-level annotation.Every pod written before this proposal holds exactly one key — an unsuffixed port inherits the pod-level
endpoint.aether.io/protocol— so the slice is one-element and all four call sites behave exactly as before.All four follow: registration (
pod.go), drain-marking and the delayed pool close (termination.go), health promotion (liveness.go), and the ghost sweep (ghostsweep.go). They share one helper,registerUnderAll, so the semantics are stated once rather than four times.Risk 5, and why the helper's return value matters
Two properties it guarantees:
The promotion path is where that becomes permanent. It records the transition on success, and the next tick then sees
prev == wantand never retries — so the other listing's endpoint staysUNHEALTHYforever, with no error raised anywhere and a cluster that merely looks like a service with no pods.One deadline, not one per key
Callers pass a single context covering all writes. Several of these run with
lifecycleMuheld (S20, #772), where a per-key timeout would let a dual-protocol pod multiply the worst-case lock hold that the bound exists to cap.Negative control
With the helper writing only the first key — which is both the pre-037 behaviour and the exact shape of Risk 5 — the two dual-key subtests fail:
and the single-protocol subtest still passes, because that path is unchanged. That third case is the one that matters for confidence in the rollout: it is every pod on the cluster today.
bazel build //...clean, 57 tests pass, lint clean.registerUnderAllwas extracted partly because inlining the loop at four sites pushed//agent/internal/cni/serverpast the gocognit threshold — consolidating was the better fix anyway.Still to come in Release B
The agent data plane:
destination_port-qualified capture chains from a cache-derived map, per-porttcp:<fqdn>:<p>clusters with SNI, per-port inbound floor chains, the 421 vhost, the scoped-mode blackhole chain, the #877 WARN, and theworkload-requirements.mdrewrite. That part carries the listener-drain risk (Risk 4) and is where 18082 stops being inert.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr