Skip to content

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

Merged
easwars merged 12 commits into
grpc:masterfrom
mswierq:fix/8994-suppress-duplicate-errors
Jul 31, 2026
Merged

xds: suppress the duplicate errors at the client side#9185
easwars merged 12 commits 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.10%. Comparing base (118203e) to head (f392ec8).
⚠️ Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9185      +/-   ##
==========================================
+ Coverage   83.09%   83.10%   +0.01%     
==========================================
  Files         422      422              
  Lines       34826    35044     +218     
==========================================
+ Hits        28938    29125     +187     
- Misses       4393     4411      +18     
- Partials     1495     1508      +13     
Files with missing lines Coverage Δ
internal/xds/clients/xdsclient/authority.go 81.25% <100.00%> (+1.69%) ⬆️

... and 35 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
Comment thread internal/xds/clients/xdsclient/authority.go Outdated
Comment thread internal/xds/clients/xdsclient/authority.go Outdated
Comment thread internal/xds/xdsclient/tests/eds_watchers_test.go
@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 Outdated
@easwars easwars assigned eshitachandwani and unassigned mswierq and mbissa Jul 8, 2026
@eshitachandwani
eshitachandwani self-requested a review July 8, 2026 15:12
Comment thread internal/xds/clients/xdsclient/test/ads_stream_ack_nack_test.go Outdated
Comment thread internal/xds/clients/xdsclient/test/ads_stream_ack_nack_test.go Outdated
Comment thread internal/xds/clients/xdsclient/authority.go Outdated
Comment thread internal/xds/clients/xdsclient/authority.go Outdated
@easwars easwars removed this from the 1.83 Release milestone Jul 14, 2026
@easwars easwars added this to the 1.84 Release milestone Jul 14, 2026
Comment thread internal/xds/clients/xdsclient/test/ads_stream_ack_nack_test.go
Comment thread internal/xds/clients/xdsclient/test/ads_stream_ack_nack_test.go Outdated
Comment thread internal/xds/clients/xdsclient/test/ads_stream_ack_nack_test.go Outdated
@eshitachandwani

Copy link
Copy Markdown
Member

LGTM, adding @easwars for a second review

Comment thread internal/xds/clients/xdsclient/authority.go Outdated
Comment thread internal/xds/clients/xdsclient/authority.go Outdated
Comment thread internal/xds/clients/xdsclient/authority.go Outdated
Comment thread internal/xds/clients/xdsclient/authority.go Outdated
Comment thread internal/xds/clients/xdsclient/authority.go Outdated
Comment thread internal/xds/clients/xdsclient/test/ads_stream_ack_nack_test.go Outdated
Comment thread internal/xds/clients/xdsclient/test/ads_stream_ack_nack_test.go Outdated
Comment thread internal/xds/clients/xdsclient/test/ads_stream_ack_nack_test.go Outdated
Comment thread internal/xds/clients/xdsclient/test/ads_stream_ack_nack_test.go Outdated
Comment on lines +583 to +587
// TestADS_NACKError_DuplicateSuppression_ConcatenatedErrorChange verifies that
// when multiple invalid resources cause a concatenated error stored in metadata,
// and a subsequent update carries a duplicate error for only a subset of resources
// (changing the concatenated error string), the client still suppresses the
// duplicate error notification to the watcher.

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.

It feels weird to me that we store the combined error (from all resource errors and top-level errors) as part of every resource that has an error. This doesn't seem right to me. I need to think about this a little more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's odd. I think storing a resource error only in state should be good enough, but maybe there is a reason, e.g. debugging/logging?

@easwars
easwars merged commit c841c90 into grpc:master Jul 31, 2026
19 checks passed
easwars added a commit that referenced this pull request Aug 3, 2026
…all error (#9283)

Follow-up from this discussion:
#9185 (comment)

RELEASE NOTES: none
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