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

Clone the RR load balancer in preparation for refactoring #2737

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

bryce-anderson
Copy link
Contributor

Motivation:

We are going to start refactoring our load balancing components
and in order to preserve the current stable form until we can build
confidence in it we're cloning RoundRobinLoadBalancer into another
class (currently identical other than name) which we can then start
to pull apart.

Modifications:

  • Add a private interface TestableLoadBalancer to expose a generic
    way of surfacing the current host set for tests.
  • Clone RoundRobinLoadBalancer into NewRoundRobinLoadBalancer which
    is currently identical to the original other than it's name.
  • Thread through the option to switch round robin load balancer
    implementation in the tests so we can detect regressions in the
    new implementation without text-copying the tests. When we get to
    the point we want to try it out we can start to surface the switch
    in the public interfaces.

Motivation:

We are going to start refactoring our load balancing components
and in order to preserve the current stable form we're cloning
it into another implementation (currently identical) which we
can then start to pull apart.

Modifications:

- Add a private interface TestableLoadBalancer to expose a generic
  way of surfacing the current host set for tests.
- Clone RoundRobinLoadBalancer into NewRoundRobinLoadBalancer which
  is currently identical to the original other than it's name.
- Thread through the option to switch round robin load balancer
  implementation in the tests so we can detect regressions in the
  new implementation without text-copying the tests. When we get to
  the point we want to try it out we can start to surface the switch
  in the public interfaces.

Result:

What is the result of this change?
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

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

🚢

@bryce-anderson bryce-anderson merged commit d539ff4 into apple:main Oct 25, 2023
15 checks passed
@bryce-anderson bryce-anderson deleted the duplicate_RR_with_tests branch October 25, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants