You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue.
What version of gRPC are you using?
1.9.0
What version of Go are you using (go version)?
1.9
What operating system (Linux, Windows, …) and version?
Linux
What did you do?
Use the round robin load balancer with multiple IP addresses resolving from a single name.
What did you expect to see?
The client should call the servers in a round robin fashion
What did you see instead?
It just resolves a single server and does not round robin the calls.
In a previous version of GRPC, where the resolver was provided to the balancer explicitly, this was not an issue.
So, this is an experimental API with very little in the way of documentation (at least that I have found) so chances are I've just been doing something stupid but if I simply use the WithBalancerName(roundrobin.Name) dial option then I don't get round robin behaviour from the load balancer. It logs a call to newPicker with a single resolved address and simply calls that.
What does work is if I add a line beforehand resolver.SetDefaultScheme("dns")
The call to newPicker then gets the expected number of addresses and the round robin balancing works as expected.
I'm not sure what I would suggest to address this but it should at least be a little more obvious that the round_robin balancer won't work with the default resolver? Or, as mentioned before, I'm just doing something odd.
The text was updated successfully, but these errors were encountered:
The default resolver was changed from "dns" back to "passthrough" in #1606. The reason is that if we change the default resolver behavior, user's tests might be broken.
A "passthrough" resolver doesn't try to resolve the target, and will return the target back directly. The target will eventually be resolved by net.Dial, but there will be no load balancing in this case.
To use the "dns" resolver, please try to add "dns:///" prefix to your target. (The target format is defined in this doc). resolver.SetDefaultScheme sets the default target scheme. If you are sure you want "dns" to be the default in your program, doing this in an init() would also be a good idea.
Sorry for the missing of documentation. I will add a doc to DialContext to explain how to pick the resolver (#1785).
Please answer these questions before submitting your issue.
What version of gRPC are you using?
1.9.0
What version of Go are you using (
go version
)?1.9
What operating system (Linux, Windows, …) and version?
Linux
What did you do?
Use the round robin load balancer with multiple IP addresses resolving from a single name.
What did you expect to see?
The client should call the servers in a round robin fashion
What did you see instead?
It just resolves a single server and does not round robin the calls.
In a previous version of GRPC, where the resolver was provided to the balancer explicitly, this was not an issue.
So, this is an experimental API with very little in the way of documentation (at least that I have found) so chances are I've just been doing something stupid but if I simply use the
WithBalancerName(roundrobin.Name)
dial option then I don't get round robin behaviour from the load balancer. It logs a call to newPicker with a single resolved address and simply calls that.What does work is if I add a line beforehand
resolver.SetDefaultScheme("dns")
The call to newPicker then gets the expected number of addresses and the round robin balancing works as expected.
I'm not sure what I would suggest to address this but it should at least be a little more obvious that the round_robin balancer won't work with the default resolver? Or, as mentioned before, I'm just doing something odd.
The text was updated successfully, but these errors were encountered: