Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds: simplify code handling certain error conditions in the resolver #8123

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Feb 25, 2025

Simplifies error handling for a couple of cases:

  • When constructing a matcher from a Route that has already gone through validation checks in the xDS client, we can ignore errors.
  • When building service config for LB policy config that we construct by hand.

Simplifying the handling of these cases greatly simplifies the next task, which is to ensure that any error reported by the resolver to the channel must include the xDS node ID. That change will be made in a follow-up PR.

Addresses: #7931

RELEASE NOTES: none

@easwars easwars requested a review from dfawley February 25, 2025 17:59
@easwars easwars added the Type: Internal Cleanup Refactors, etc label Feb 25, 2025
@easwars easwars added this to the 1.72 Release milestone Feb 25, 2025
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 56.00000% with 11 lines in your changes missing coverage. Please review.

Project coverage is 82.15%. Comparing base (dbf92b4) to head (a562552).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
xds/internal/resolver/xds_resolver.go 46.66% 6 Missing and 2 partials ⚠️
xds/internal/xdsclient/xdsresource/matcher.go 50.00% 2 Missing ⚠️
xds/internal/resolver/serviceconfig.go 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8123      +/-   ##
==========================================
- Coverage   82.18%   82.15%   -0.03%     
==========================================
  Files         387      387              
  Lines       38947    38936      -11     
==========================================
- Hits        32007    31988      -19     
- Misses       5613     5622       +9     
+ Partials     1327     1326       -1     
Files with missing lines Coverage Δ
xds/internal/xdsclient/xdsresource/filter_chain.go 92.88% <100.00%> (+0.14%) ⬆️
xds/internal/resolver/serviceconfig.go 87.07% <80.00%> (+0.63%) ⬆️
xds/internal/xdsclient/xdsresource/matcher.go 64.15% <50.00%> (ø)
xds/internal/resolver/xds_resolver.go 80.78% <46.66%> (-0.75%) ⬇️

... and 16 files with indirect coverage changes

@@ -38,8 +41,6 @@ func RouteToMatcher(r *Route) (*CompositeMatcher, error) {
pm = newPathExactMatcher(*r.Path, r.CaseInsensitive)
case r.Prefix != nil:
pm = newPathPrefixMatcher(*r.Prefix, r.CaseInsensitive)
default:
return nil, fmt.Errorf("illegal route: missing path_matcher")
Copy link
Member

Choose a reason for hiding this comment

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

Should we leave this, with a panic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Done here and below.

@easwars easwars force-pushed the xds_resolver_simplify branch from ead5735 to a562552 Compare February 26, 2025 23:00
@easwars easwars merged commit e9c0617 into grpc:master Feb 26, 2025
15 checks passed
@easwars easwars deleted the xds_resolver_simplify branch February 26, 2025 23:17
purnesh42H pushed a commit to purnesh42H/grpc-go that referenced this pull request Mar 1, 2025
cds: stop child policies on resource-not-found errors (grpc#8122)

xds: simplify code handling certain error conditions in the resolver (grpc#8123)

xds, pickfirst: Enable additional addresses in xDS, set new pick_first as default (grpc#8126)

github: change test action to cover the legacy pickfirst balancer (grpc#8129)

cleanup: replace dial with newclient (grpc#7967)

cleanup: replace dial with newclient (grpc#7970)

stats/openetelemetry: refactor and make e2e test stats verification deterministic (grpc#8077)

xds: introduce simple grpc transport for generic xds clients (grpc#8066)

xds: generic xds client common configs

re-push comments

improve ServerConfig equal

easwar review round 1 on documentation

easwar comments on docstrings

easwar comments round 4

config tests

merge with previous pr

xds: add lrs client and xDS client interfaces

second pass to documentation language

change from godoc review

dfawley review 2

easwar review 1

changed to decoder struct

move authorities under xds client

easwar review 2

easwars review 4

ResourceWatcher done and LoadStore stop

grpc based transport

remove server config extension interface

add byte codec

dfawley review 1

send and recv tests with byte based test server

change to proto based server

easwar review 1

easwar review 3

xds: generic xds client ads transport channel
purnesh42H pushed a commit to purnesh42H/grpc-go that referenced this pull request Mar 1, 2025
ads: stop child policies on resource-not-found errors (grpc#8122)

xds: simplify code handling certain error conditions in the resolver (grpc#8123)

xds, pickfirst: Enable additional addresses in xDS, set new pick_first as default (grpc#8126)

github: change test action to cover the legacy pickfirst balancer (grpc#8129)

cleanup: replace dial with newclient (grpc#7967)

cleanup: replace dial with newclient (grpc#7970)

stats/openetelemetry: refactor and make e2e test stats verification deterministic (grpc#8077)

xds: introduce simple grpc transport for generic xds clients (grpc#8066)

xds: generic xds client common configs

re-push comments

improve ServerConfig equal

easwar review round 1 on documentation

easwar comments on docstrings

easwar comments round 4

config tests

merge with previous pr

xds: add lrs client and xDS client interfaces

second pass to documentation language

change from godoc review

dfawley review 2

easwar review 1

changed to decoder struct

move authorities under xds client

easwar review 2

easwars review 4

ResourceWatcher done and LoadStore stop

grpc based transport

remove server config extension interface

add byte codec

dfawley review 1

send and recv tests with byte based test server

change to proto based server

easwar review 1

easwar review 3

xds: generic xds client ads transport channel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants