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

xdsclient: invoke connectivity failure callback only after all listed servers have failed #8075

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Feb 10, 2025

Implements the update to gRFC A71 made in grpc/proposal#473.

RELEASE NOTES:

  • xdsclient: Fixes a bug where connectivity failures were reported to resource watchers before trying all listed servers.

@easwars easwars requested a review from dfawley February 10, 2025 16:27
@easwars easwars added this to the 1.71 Release milestone Feb 10, 2025
@easwars easwars requested a review from purnesh42H February 10, 2025 16:28
Copy link

codecov bot commented Feb 10, 2025

Codecov Report

Attention: Patch coverage is 85.29412% with 5 lines in your changes missing coverage. Please review.

Project coverage is 82.27%. Comparing base (ad5cd32) to head (b763853).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
xds/internal/xdsclient/authority.go 85.29% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8075      +/-   ##
==========================================
+ Coverage   82.10%   82.27%   +0.16%     
==========================================
  Files         387      387              
  Lines       39067    39051      -16     
==========================================
+ Hits        32076    32128      +52     
+ Misses       5662     5605      -57     
+ Partials     1329     1318      -11     
Files with missing lines Coverage Δ
xds/internal/xdsclient/authority.go 78.07% <85.29%> (+0.95%) ⬆️

... and 25 files with indirect coverage changes

for _, rType := range a.resources {
for _, state := range rType {
for watcher := range state.watchers {
watcher := watcher
Copy link
Member

Choose a reason for hiding this comment

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

I believe this is not needed post-Go 1.22?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you are right. Thanks.

}
return
return false
Copy link
Member

Choose a reason for hiding this comment

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

Why false here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't to notify watchers in this case, because we have a higher priority server failing (during a retry after backoff), while a lower priority server is either successfully connected or in the process of connecting.

t.Fatalf("Failed to create gRPC client: %v", err)
}
defer cc.Close()
cc.Connect()
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we skip this? Otherwise it's possible the client fully connects before we even dispatch the RPC to the channel. OK, that's very unlikely, but there should be no need for this call, anyway AFAICT.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. Done. Thanks.

@dfawley dfawley assigned easwars and purnesh42H and unassigned dfawley Feb 10, 2025
@easwars easwars force-pushed the xds_fallback_bug_8057 branch from 0417b07 to b763853 Compare February 11, 2025 19:23
@easwars easwars merged commit 4b5608f into grpc:master Feb 11, 2025
15 checks passed
@easwars easwars deleted the xds_fallback_bug_8057 branch February 11, 2025 19:30
janardhanvissa pushed a commit to janardhanvissa/grpc-go that referenced this pull request Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants