Skip to content

balancer/rls: Fix RLS failure mode by treating response with no targets as an error #6735

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

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

zasweq
Copy link
Contributor

@zasweq zasweq commented Oct 17, 2023

Fixes #6719. Previously, the RLS Balancer would not treat an RLS response with no targets as an error. This PR makes it treat an RLS response with no targets as an error.

The relevant language from the RLS LB Design document: "An RLS request is considered to have failed if it returns a non-OK status or the RLS response's targets list is non-empty."

RELEASE NOTES:

  • balancer/rls: Fix RLS failure mode by treating response with no targets as an error

@zasweq zasweq requested a review from dfawley October 17, 2023 23:58
@zasweq zasweq changed the title balancer/rls: Fix RLS failure mode, response with no non empty targets should be treated as an error balancer/rls: Fix RLS failure mode by treating response with no non empty targets as an error Oct 17, 2023
@zasweq zasweq added this to the 1.59 Release milestone Oct 18, 2023
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #6735 (0f1da99) into master (cb430be) will increase coverage by 0.11%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files

@dfawley dfawley assigned zasweq and unassigned dfawley Oct 18, 2023
Comment on lines 266 to 269
if allTargetsEmpty {
if err == nil {
err = fmt.Errorf("RLS response's target list does not contain any non-empty entries for key %+v", cacheKey)
}
Copy link
Member

Choose a reason for hiding this comment

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

Let's move this if err == nil check to surround all of this new logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, alongside implementing offline discussion wrt just checking length of targets slice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated description.

@zasweq zasweq assigned dfawley and unassigned zasweq Oct 18, 2023
@zasweq zasweq changed the title balancer/rls: Fix RLS failure mode by treating response with no non empty targets as an error balancer/rls: Fix RLS failure mode by treating response with no targets as an error Oct 18, 2023
Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

Please update the PR description further, specifically:

  • It still says "no non-empty targets" in multiple places

  • I think you can delete this since the input should be valid and not special?: "There's no good way to test the case where you get targets: []string{""} in my opinion. If you feel strongly about this I can try and figure out a test with the right error code/message here."

@dfawley dfawley assigned zasweq and unassigned dfawley Oct 18, 2023
@zasweq
Copy link
Contributor Author

zasweq commented Oct 18, 2023

Updated PR description further.

@zasweq zasweq merged commit b046cca into grpc:master Oct 18, 2023
1 check passed
arvindbr8 pushed a commit to arvindbr8/grpc-go that referenced this pull request Nov 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rls: response with no targets should be treated as an error
2 participants