Repository navigation
fix(agent): a CNI ADD whose snapshot is installed succeeds although an open watch was not answered from it (#1620) - #1631
Merged
Conversation
…n open watch was not answered from it (#1620) Since #1625 a snapshot build that could not hand a response to an open watch within its bound returns cache.ErrWatchNotAnswered: the snapshot is installed and served. The CNI server still read it as a failed build. Every caller of the snapshot cache in agent/internal/cni/server now passes the mutator's error through one helper. For the sentinel it logs a WARN, adds one to aether.agent.cni.snapshot_watch_unanswered{aether.snapshot.caller} and returns nil; every other error is returned unchanged. - CNI ADD: answered with success instead of Internal, so the runtime no longer tears down and retries a sandbox whose listeners are published. - CNI DEL and the ghost sweep: already best-effort; they no longer log that the listener was not removed when it was. - surge takeover: the step is no longer logged as failed for listeners that are installed. The server holds the cache behind a three-method interface so a test can return the sentinel without waiting out the cache's 5 s bound. Closes #1620 Co-Authored-By: Claude Opus 5.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.
Closes #1620
What was wrong
Since #1625 a snapshot build that could not hand a response to an open watch within its bound returns
cache.ErrWatchNotAnswered, wrapped by every mutator. The snapshot is installed and is the one every later request is answered from.agent/internal/cni/serverstill treated that error as a build that failed: a CNI ADD was answeredInternal, and the runtime tore down and retried a sandbox whose listeners were published.What is true now
Every caller of the snapshot cache in the CNI server passes the mutator's error through one helper (
snapshotInstalled,snapshotwatch.go). Forerrors.Is(err, cache.ErrWatchNotAnswered)it logs a WARN, counts, and returns nil. Every other error is returned unchanged.AddPod)codes.Internal, sandbox retriedRESULT_SUCCESS; the best-effort ACK wait still runsremovePodListeners)failed to remove listenerpruneOnePod)failed to drop listener for pruned podReconcileStorage)takeover step failedAny other error keeps what it had: the ADD is
codes.Internalwithfailed to add listener: …, the DEL and the sweep log their ERROR, the takeover step returns the joined error.What an operator sees
pod's snapshot change is installed, but an open watch was not answered from it; not a failure, a later snapshot build sends the proxy the change, withpod,namespace,calleranderror. The build's own WARN (snapshot installed, but an open watch was not answered from it, withsnapshot_version) precedes it.aether.agent.cni.snapshot_watch_unanswered{aether.snapshot.caller}(Prometheusaether_agent_cni_snapshot_watch_unanswered_total{aether_snapshot_caller}),callerone ofcni_add,cni_del,takeover,ghost_sweep, each exported at zero. It is not expected to move (agent: one unread xDS watch can stall every snapshot build on the node #1619). Documented indocs/runbook.mdbeside the build's line.How it is tested
The server now holds the cache behind a three-method interface (
podSnapshots), so a test can return the sentinel without waiting out the cache's 5 s bound, which this package cannot shorten.NewCNIServerstill takes*cache.SnapshotCache.snapshotwatch_test.go, per caller, the sentinel and another error:Internal, the DEL and the sweep logged ERROR and counted nothing, the takeover returned the error;Run locally:
//agent/internal/cni/server:server_test(also under--config=race),//test/harnesscontract:checks,//agent/internal/cmd/..., the lint build over//...withfail_on_violation,make format-check.No chart change. The external-harness contract is unchanged (a new metric, in no closed set).
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr