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: NACK endpoint resources with zero weight #5560

Merged
merged 1 commit into from Aug 3, 2022

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Aug 3, 2022

This is the existing behavior in other languages already (and Envoy), and we are late to the party.

Fixes: #5456

Summary of changes:

  • Change the unmarshaling routine in xdsclient to error out if it sees an endpoint resource with zero weight
  • Change test routines to insert a weight of 1 in all endpoint resources that they use
  • Fix existing tests to expect endpoints with weight 1
  • Add a test for the zero endpoint case

RELEASE NOTES:

  • xds: NACK endpoint resources with zero weight

@easwars easwars added this to the 1.49 Release milestone Aug 3, 2022
@easwars easwars requested a review from zasweq August 3, 2022 00:24
@easwars easwars force-pushed the eds_nack_zero_weight_endpoint branch from ba1932c to fa6b943 Compare August 3, 2022 15:56
Copy link
Contributor

@zasweq zasweq left a comment

Choose a reason for hiding this comment

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

LGTM outside of minor nit.

@@ -134,9 +138,13 @@ func parseEDSRespProto(m *v3endpointpb.ClusterLoadAssignment, logger *grpclog.Pr
return EndpointsUpdate{}, fmt.Errorf("duplicate locality %s with the same priority %v", lidStr, priority)
}
localitiesWithPriority[lidStr] = true
endpoints, err := parseEndpoints(locality.GetLbEndpoints())
if err != nil {
return EndpointsUpdate{}, err
Copy link
Contributor

Choose a reason for hiding this comment

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

Please wrap this err with more information (see other errors in this function).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

parseEndpoints returns an error which has all the required information.

@zasweq zasweq assigned easwars and unassigned zasweq Aug 3, 2022
@easwars easwars merged commit 946dde0 into grpc:master Aug 3, 2022
@easwars easwars deleted the eds_nack_zero_weight_endpoint branch August 3, 2022 23:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2023
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.

xdsclient: NACK eds resource with endpoint weight set to zero
2 participants