-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(grpc): add round_robin LB policy #2451
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
base: master
Are you sure you want to change the base?
Conversation
| // | ||
| // The state is determined according to normal state aggregation rules, and | ||
| // the picker round-robins between all children in that state. | ||
| fn resolve_child_updates(&mut self, channel_controller: &mut dyn ChannelController) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't particularly see it doing anything related to resolver? It is using resolve as an overloaded termm here? It seems closer to update_picker to me from the implementation.
|
|
||
| impl TestSubchannelList { | ||
| fn new(addresses: &Vec<Address>, channel_controller: &mut dyn ChannelController) -> Self { | ||
| let mut scl = TestSubchannelList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: more descriptive name like subchannel_list
| } | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a lot of boilerplate before the tests even start ~400+ LOC. Is this expected? Will dependency injection and mocking childmanager and pick first help here?
Additionally, I am not sure if it applies here. But go/tott/643 somewhat recommends leaning heavily towards not overabstracting utility functions to keep things dry.
| assert!( | ||
| picked[0] != picked[1].clone(), | ||
| "Should alternate between subchannels" | ||
| ); | ||
| assert_eq!(&picked[0], &picked[2]); | ||
| assert_eq!(&picked[1], &picked[3]); | ||
| assert!(picked.contains(&subchannels[0])); | ||
| assert!(picked.contains(&subchannels[1])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is detereministic, so can we assert the entire container of pickers chosen?
| for child_idx in 0..self.children.len() { | ||
| let child = &mut self.children[child_idx]; | ||
| let mut channel_controller = WrappedController::new(channel_controller); | ||
| let _ = child.policy.resolver_update( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this variable?
|
Thanks for the amazing test descriptions. They were really amazing at smoothening the test reviews. |
This change is based heavily on #2405, especially the tests.