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: resubmit xds client pool changes from #7898 along with fix to set fallback bootstrap config from googledirectpath to xdsclient pool #8050

Merged

Conversation

purnesh42H
Copy link
Contributor

@purnesh42H purnesh42H commented Jan 29, 2025

Change #7898 introduced a pool of xDS clients that share the same configuration within the pool, instead of using a single global map of xDS clients.

After #7898 changes, production path of xdsclient will maintain a default pool populated with the bootstrap configuration during init() using the internal bootstrap.GetConfiguration() function. This function reads the configuration from environment variables. Currently, bootstrap.GetConfiguration() also includes logic to read the fallback configuration set by the c2pResolver (from the googledirectpath library) during its Build() method. After change #7898, this Build() method executes after init(), so the fallback bootstrap configuration set by the c2pResolver is not assigned to xdsclient.DefaultPool.

#7898 was reverted because c2p resolver was broken. This pull request resubmit changes from #7898 and modifies the c2pResolver to set the fallback bootstrap configuration on the assigned xDS client pool (defaulting to xdsclient.DefaultPool) and removes the fallback bootstrap configuration logic from internal/xds/bootstrap.

RELEASE NOTES:

  • xds: Implement an xDS client pool to allow creating multiple servers/channels with varying bootstrap configurations within a single test.

@purnesh42H purnesh42H requested a review from easwars January 29, 2025 09:34
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 80.70866% with 49 lines in your changes missing coverage. Please review.

Project coverage is 82.18%. Comparing base (1318104) to head (0ebd548).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
xds/internal/xdsclient/pool.go 78.78% 15 Missing and 6 partials ⚠️
xds/internal/xdsclient/clientimpl.go 84.48% 13 Missing and 5 partials ⚠️
internal/testutils/xds/e2e/setup/setup.go 16.66% 3 Missing and 2 partials ⚠️
xds/internal/resolver/xds_resolver.go 72.72% 2 Missing and 1 partial ⚠️
xds/googledirectpath/googlec2p.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8050      +/-   ##
==========================================
- Coverage   82.23%   82.18%   -0.06%     
==========================================
  Files         387      387              
  Lines       39015    39042      +27     
==========================================
+ Hits        32085    32086       +1     
- Misses       5591     5619      +28     
+ Partials     1339     1337       -2     
Files with missing lines Coverage Δ
internal/xds/bootstrap/bootstrap.go 65.91% <100.00%> (-2.95%) ⬇️
xds/internal/xdsclient/client.go 100.00% <100.00%> (ø)
xds/internal/xdsclient/xdsresource/errors.go 100.00% <ø> (ø)
xds/server.go 82.20% <100.00%> (-0.84%) ⬇️
xds/server_options.go 100.00% <100.00%> (ø)
xds/googledirectpath/googlec2p.go 93.33% <50.00%> (+0.22%) ⬆️
xds/internal/resolver/xds_resolver.go 78.65% <72.72%> (-0.73%) ⬇️
internal/testutils/xds/e2e/setup/setup.go 64.70% <16.66%> (-17.65%) ⬇️
xds/internal/xdsclient/clientimpl.go 79.16% <84.48%> (+6.21%) ⬆️
xds/internal/xdsclient/pool.go 78.78% <78.78%> (ø)

... and 24 files with indirect coverage changes

@purnesh42H purnesh42H added Area: xDS Includes everything xDS related, including LB policies used with xDS. Type: Internal Cleanup Refactors, etc labels Jan 29, 2025
@purnesh42H purnesh42H added this to the 1.71 Release milestone Jan 29, 2025
@purnesh42H purnesh42H changed the title xds: set fallback bootstrap config from googledirectpath to xdsclient pool xds: set fallback bootstrap config from googledirectpath to xdsclient pool and remove fallback config logic from internal bootstrap package Jan 29, 2025
@purnesh42H purnesh42H requested a review from dfawley January 29, 2025 11:52
@purnesh42H purnesh42H force-pushed the googlec2p-set-config-to-xdslcient-pool branch from d3593b5 to 9913166 Compare January 29, 2025 12:31
@purnesh42H purnesh42H force-pushed the googlec2p-set-config-to-xdslcient-pool branch from 9913166 to 7e30b9b Compare January 30, 2025 19:52
@purnesh42H purnesh42H force-pushed the googlec2p-set-config-to-xdslcient-pool branch 8 times, most recently from e2ff42a to 0351f6e Compare January 31, 2025 08:55
@purnesh42H purnesh42H force-pushed the googlec2p-set-config-to-xdslcient-pool branch from 0351f6e to 6393911 Compare January 31, 2025 09:01
@purnesh42H
Copy link
Contributor Author

purnesh42H commented Jan 31, 2025

@purnesh42H : I discussed offline with @dfawley and we are in agreement that just my review is enough for this PR. So, please address the remaining comments and the merge conflicts and assign it back to me when its good to be looked at. Thanks.

Thanks. I have added back the xds client pool changes and resolved conflicts. Its ready for review.

@purnesh42H purnesh42H requested a review from easwars January 31, 2025 09:35
@purnesh42H purnesh42H assigned easwars and unassigned purnesh42H Jan 31, 2025
@purnesh42H purnesh42H force-pushed the googlec2p-set-config-to-xdslcient-pool branch 3 times, most recently from d49b7ea to 0ce1d97 Compare January 31, 2025 09:58
xdsClientImplCreateHook = func(string) {}
xdsClientImplCloseHook = func(string) {}

defaultStreamBackoffFunc = backoff.DefaultExponential.Backoff
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: s/defaultStreamBackoffFunc/defaultExponentialBackoff

We are trying to following a style where we name the variable which stores the function being overridden with the same name as the latter. So, something like a rand.Shuffle being overridden would have a name of randShuffle or randShuffleFunc so that in non-test code when you see the variable name, you kind of know what the actual function is.

@@ -144,6 +144,13 @@ func (p *Pool) SetFallbackBootstrapConfig(config *bootstrap.Config) {
p.config = config
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't run any tests of the same package in parallel. A grep for t.Parallel returns no results in our repo.

easwars@minetop: grpc-go$ grep -r "t.Parallel" *
easwars@minetop: grpc-go$ 

Tests from different packages are automatically run in parallel by the go test command though. So, if you are seeing problems with this, then some other tests also use the global default pool. Can you please check? Thanks.

@easwars easwars assigned purnesh42H and unassigned easwars Feb 3, 2025
@purnesh42H purnesh42H changed the title xds: set fallback bootstrap config from googledirectpath to xdsclient pool and remove fallback config logic from internal bootstrap package xds: resubmit xds client pool changes from #7898 along with fix to set fallback bootstrap config from googledirectpath to xdsclient pool Feb 3, 2025
@purnesh42H purnesh42H merged commit 79b6830 into grpc:master Feb 4, 2025
15 checks passed
janardhanvissa pushed a commit to janardhanvissa/grpc-go that referenced this pull request Feb 15, 2025
…o set fallback bootstrap config from googledirectpath to xdsclient pool (grpc#8050)
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: Internal Cleanup Refactors, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants