Skip to content

xds: suppress the duplicate errors at the client side#9185

Open
mswierq wants to merge 1 commit into
grpc:masterfrom
mswierq:fix/8994-suppress-duplicate-errors
Open

xds: suppress the duplicate errors at the client side#9185
mswierq wants to merge 1 commit into
grpc:masterfrom
mswierq:fix/8994-suppress-duplicate-errors

Conversation

@mswierq

@mswierq mswierq commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #8994

This change suppresses duplicate errors on the xds client side by skipping calling watchers for the duplicates. This also prevents generating new child names for the same broken EDS resource (EDS resource has no localities) that is being re-send by the control plane.

RELEASE NOTES:

  • xds: handle receipt of duplicated errors at the client side by suppressing them in the same manner the duplicate updates are suppressed

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.08%. Comparing base (cd25711) to head (35d57a6).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9185      +/-   ##
==========================================
- Coverage   83.20%   83.08%   -0.12%     
==========================================
  Files         418      419       +1     
  Lines       33741    33867     +126     
==========================================
+ Hits        28073    28140      +67     
- Misses       4250     4290      +40     
- Partials     1418     1437      +19     
Files with missing lines Coverage Δ
internal/xds/clients/xdsclient/authority.go 80.24% <100.00%> (-0.31%) ⬇️

... and 39 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mbissa mbissa self-assigned this Jun 16, 2026
@easwars easwars requested a review from eshitachandwani June 17, 2026 18:20
@easwars easwars added Type: Bug Area: xDS Includes everything xDS related, including LB policies used with xDS. labels Jun 17, 2026
@easwars easwars added this to the 1.83 Release milestone Jun 17, 2026
isDuplicateErr := state.md.ErrState != nil && state.md.ErrState.Err != nil && state.md.ErrState.Err.Error() == uErr.Err.Error()
var errState *xdsresource.UpdateErrorMetadata
if md.ErrState != nil {
errState = &xdsresource.UpdateErrorMetadata{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to do this ? Can't we directly do state.md.ErrState = md.ErrState like earlier ?

})
}
state.md.ErrState = md.ErrState
isDuplicateErr := state.md.ErrState != nil && state.md.ErrState.Err != nil && state.md.ErrState.Err.Error() == uErr.Err.Error()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also instead of evaluating this as a variable and then checking can we instead do the assignment first(which I assume needs to be done for either case) and then directly in an if block we can evaluate the condition and call continue on true. WDYT ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have the test in https://github.com/grpc/grpc-go/blob/master/internal/xds/clients/xdsclient/test/lds_watchers_test.go or any other test file in the internal/xds/clients/xdsclient package instead of having it in a different xdsclient/tests package?
Or if there is a reason that we have added the test here , please let me know.

@eshitachandwani eshitachandwani modified the milestone: 1.83 Release Jun 22, 2026
@eshitachandwani

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces duplicate error suppression for ADS resource updates in the xDS client, skipping watcher notifications when duplicate errors are received, and adds a corresponding test to verify this behavior. The reviewer identified a critical issue in authority.go where a nil pointer dereference panic could occur if md.ErrState is nil but uErr.Err is non-nil, and provided a code suggestion to safely initialize errState.

Comment thread internal/xds/clients/xdsclient/authority.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: xDS Includes everything xDS related, including LB policies used with xDS. Type: Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cdsbalancer: priority LB name generation logic creates new names everytime when the EDS resource has no localities

4 participants