-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
grpclb: filter out grpclb addresses if balancer in use is not grpclb #2509
Conversation
This can happen when resolved addresses contain grpclb address, but grpclb is not registered.
balancer/balancer.go
Outdated
// balancer map. | ||
// | ||
// This function is not thread-safe. And should only be used for testing. | ||
func UnregisterForTesting(name string) { |
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.
Can we move this into internal
, please? (I.e. store the map itself there.) I want to avoid cluttering our external API with implementation details or testing functions at all costs.
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.
Added an internal function pointer.
balancer_switching_test.go
Outdated
r, rcleanup := manual.GenerateAndRegisterManualResolver() | ||
defer rcleanup() | ||
|
||
numServers := 3 |
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.
const
(or just delete and use the 3 directly on the following line)
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.
Done.
This can happen when resolved addresses contain grpclb address, but grpclb is
not registered.