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

weightedtarget: return erroring picker when no targets are configured #8070

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Feb 7, 2025

Fixes a bug in the weighted_target LB policy wherein it was queueing RPCs even though it was setting the overall connectivity state to TRANSIENT_FAILURE.

RELEASE NOTES:

  • weightedtarget: return erroring picker when no targets are configured
  • xds: fail RPCs with UNAVAILABLE when the EDS resource is missing or contains no endpoints

@easwars easwars requested a review from dfawley February 7, 2025 19:34
@easwars easwars added this to the 1.71 Release milestone Feb 7, 2025
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.18%. Comparing base (ad5cd32) to head (22ad462).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8070      +/-   ##
==========================================
+ Coverage   82.10%   82.18%   +0.08%     
==========================================
  Files         387      387              
  Lines       39067    39080      +13     
==========================================
+ Hits        32076    32118      +42     
+ Misses       5662     5639      -23     
+ Partials     1329     1323       -6     
Files with missing lines Coverage Δ
...er/weightedtarget/weightedaggregator/aggregator.go 94.26% <100.00%> (+0.22%) ⬆️
xds/internal/resolver/xds_resolver.go 79.47% <100.00%> (+0.43%) ⬆️

... and 22 files with indirect coverage changes

@@ -323,6 +364,11 @@ func (s) TestWeightedTarget(t *testing.T) {
if state != connectivity.TransientFailure {
t.Fatalf("Empty target update should have triggered a TF state update, got: %v", state)
}
p = <-cc.NewPickerCh
const wantErr = "no targets to pick from"
if _, err := p.Pick(balancer.PickInfo{}); !strings.Contains(err.Error(), wantErr) {
Copy link
Member

Choose a reason for hiding this comment

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

If err is nil this will panic.

Suggested change
if _, err := p.Pick(balancer.PickInfo{}); !strings.Contains(err.Error(), wantErr) {
if _, err := p.Pick(balancer.PickInfo{}); err == nil || !strings.Contains(err.Error(), wantErr) {

Or

	if _, err := p.Pick(balancer.PickInfo{}); !strings.Contains(fmt.Sprint(err), wantErr) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Done.

@dfawley dfawley assigned easwars and unassigned dfawley Feb 10, 2025
@easwars easwars force-pushed the weighted_target_error_picker branch from 1947074 to 22ad462 Compare February 11, 2025 19:22
@easwars easwars merged commit 0003b4f into grpc:master Feb 11, 2025
15 checks passed
@easwars easwars deleted the weighted_target_error_picker branch February 11, 2025 19:40
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.

2 participants