-
Notifications
You must be signed in to change notification settings - Fork 26
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
Connect to multiple addresses #7
Comments
As of today's
Seems to have been intentionally broken here: |
@FauxFaux I believe, it does not panic, it returns |
What would be the best way to solve this problem? It seems like the simplest solution would be to choose a random address from the list. Could it also be added as an option to have it just choose the first address that it resolves to? Currently this is a blocking issue for one of my projects, and I would be interested in contributing a solution. |
First, as a workaround, you can resolve addr yourself, and call About proper solution. As I said, "client should attempt to connect to several addresses".
should be changed to connect concurrently to multiple addresses instead of one. Alternatively, a single-connection client ( |
My worry with that workaround is that I need the Authority header to be set properly. If I manually resolve it will just be set to the ip right? Is it generally the correct behavior to connect to all of the IPs resolved by the DNS query? I thought (and might be wrong) that when a DNS record resolved to multiple IPs it was to provide round robin load balancing and graceful failover, wouldn't simultaneously connecting break that down? Or would the goal be to race the connection futures and pick whichever resolves first? |
Authority is passed explicitly to each client call, e. g.
Yep, using the algorithm like that or having a configuration option specifying connect strategy should be the right thing, but for the starters connecting to multiple addresses concurrently is acceptable I think.
I think that multiple IP addresses could be used for failover. So as before I think the proper strategy is to connect to the first address, and after a failure or after small timeout connect to second address etc. But I'm not an expert, I can be wrong. |
Any update on this? Not being able to connect to hosts with multiple addresses (without manually resolving first) is a pain for many services. |
Currently
Client
connects to single address, first address name resolved to.Instead, client should attempt to connect to several addresses: both IPv4 and IPv6, and to multiple addresses resolved by DNS.
The text was updated successfully, but these errors were encountered: