Skip to content

fix(router): Stop VIP binding status writes conflicting with health - #1576

Merged
privateip merged 2 commits into
mainfrom
fix/issue-1380
Dec 2, 2026
Merged

privateip merged 2 commits into
mainfrom
fix/issue-1380

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Summary

On nodes with FailClosed health-checked VIP bindings, the router's binding controller kept failing its status writes with "object has been modified", which kept the reconcile error-floor alert firing even though retries succeeded and traffic was unaffected.

The health checker patches the binding's health status after every probe, while the binding controller rewrote the whole status from its cache on every reconcile and re-ran every binding on the node for each probe.

The binding controller now writes status only when it changes, as a merge patch that cannot conflict with the health patch, and ignores updates that change only the status.

The API is unchanged, so rollback is a plain downgrade.

Test plan

  • A health patch that lands between the controller's read and write no longer fails the reconcile, and both writes survive
  • Reconciling an unchanged binding writes no status
  • Status-only updates no longer trigger a reconcile, while spec, metadata, deletion and resync updates still do
  • Lint, build, unit and e2e suites pass

Fixes #1380

On a node whose ServiceVIPBindings use a FailClosed health check, the
servicevipbinding controller logged a reconcile error every few
minutes, enough to keep the reconcile error-floor alert firing. Each
error was a conflict on the binding's status write. Retries succeeded,
so traffic was unaffected.

The backend health checker in the same router patches status.health
after every FailClosed probe, because lastProbeTime changes each time.
reconcileBind then wrote the whole status with a resourceVersion-checked
Update from its cached copy, on every reconcile, whether or not
anything changed. Any health patch that landed between the read and
the write made it fail. Each health patch also re-ran the binding and,
through the peer watch, every other binding on the node, so a node with
a few bindings reconciled several times a second.

reconcileBind now writes status only when it changes, as a merge patch
of the fields it owns. The patch has no resourceVersion, so it cannot
conflict with the health patch, and the health checker's own patch
never touches the Bound condition. These are the only two writers of
this status. A retry on conflict would hide the race and keep the
redundant write, so it was not used.

The For watch and the peer watch now drop updates that change only the
status. Updates still pass when the generation, labels, annotations,
finalizers or deletion timestamp change, and resyncs pass so the
periodic datapath re-check still runs. Peer conflict resolution reads
only spec and deletion state, so peers lose nothing.

The backend health guide claimed one health patch per transition. It
now says FailClosed patches once per probe interval, documents
lastProbeTime and states the Bound write contract.

Fixes #1380
@privateip privateip self-assigned this Dec 2, 2026
The Bound status write is a JSON merge patch, which replaces the
whole status.conditions list. Say in reconcileBind's comment that this
reconciler must stay the only writer of that list, so a second writer
added later does not have its conditions silently dropped.

Related to #1380
@privateip
privateip marked this pull request as ready for review December 2, 2026 02:59
@privateip
privateip requested a review from a team as a code owner December 2, 2026 02:59
@privateip

Copy link
Copy Markdown
Contributor Author

Two independent reviews ran on aa95a23, and both returned merge.

The correctness review built, vetted and ran the binding tests in the controller package. Its one nit was that a merge patch replaces the whole conditions list, so the binding reconciler has to stay its only writer. e5b2a61 adds that note to the code comment.

The conventions review checked reach and open-PR collisions and found none, because no manifest or overlay changed.

Both new regression tests fail on main at 2d5d35b. The health-patch race fails with the same "object was modified" conflict, and an unchanged binding gets 3 status writes over 3 reconciles. Both pass with this change.

All required checks pass on e5b2a61, including E2E and root unit tests. Auto-merge is left off, so this needs a person to merge after approval.

@privateip
privateip merged commit 77186ec into main Dec 2, 2026
28 checks passed
@privateip
privateip deleted the fix/issue-1380 branch December 2, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Router binding status saves keep conflicting with fail-closed health checks

2 participants