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

balancer/base: keep address attributes for pickers #4253

Merged
merged 3 commits into from
Mar 25, 2021

Conversation

longXboy
Copy link
Contributor

@longXboy longXboy commented Mar 9, 2021

#4024 caused the Addresses.Attributes of readySCs obtained by pickerBuilder to be nil when regeneratePicker.

1.add subConnInfo struct which contains subConn and attributes.
2.add attributes to aNoAttrs when generate readySCs.

fixes #4276

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 9, 2021

CLA Signed

The committers are authorized under a signed CLA.

@menghanl menghanl self-assigned this Mar 11, 2021
@menghanl menghanl added the Type: Behavior Change Behavior changes not categorized as bugs label Mar 18, 2021
@menghanl menghanl added this to the 1.37 Release milestone Mar 18, 2021
Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. And sorry for the delay.

This fix looks good to me.
Can you add a test to make sure that the pickers can get the attributes?
Thanks!

@longXboy
Copy link
Contributor Author

Thanks for the fix. And sorry for the delay.

This fix looks good to me.
Can you add a test to make sure that the pickers can get the attributes?
Thanks!

ok,I will add some tests

@longXboy
Copy link
Contributor Author

@menghanl test cases added!

Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix!

t.Errorf("in picker.validate, got address %+v with nil attributes, want not nil", sc.Address)
}
foo, ok := sc.Address.Attributes.Value("foo").(string)
if !ok || foo != "2233niang" {
Copy link
Contributor

Choose a reason for hiding this comment

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

🤦‍♂️

@menghanl menghanl changed the title balancer: Fix base balancer set nil attributes into readySCs balancer/base: keep address attributes for pickers Mar 25, 2021
@menghanl menghanl merged commit 80e380e into grpc:master Mar 25, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Behavior Change Behavior changes not categorized as bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The attributes of the address is removed when passing to the picker.
4 participants