-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Resolve IPv6 address takes too much time #696
Comments
Perhaps we can add this as an option? |
I don't understand the reason behind here to try IPv4 first, then IPv6 in order. Doesn't it always working no matter get IPv4 or IPv6 whatever configured? |
The normal way to do this is as zh1029 says and use AF_UNSPEC with a single call to getaddrinfo() Underneath, getaddrinfo() will race to find working IPv4 and IPv6 addresses, preferring IPv6 (i.e IPv6 addresses will be the first in the list as returned). I believe this is part of the 'Happy Eyeballs' protocol. |
I've not heard of this before, but it looks interesting. It seems reasonable to add this logic as long as we can do it without breaking too many things. |
Good morning! This has been discussed recently in the Redis main repo. DNS-lookup has been added in TL;DR for
For hiredis, I suggest we do something similar.
|
We have nss-mdns (http://0pointer.de/lennart/projects/nss-mdns/#documentation) deployed in our system and publish IPv6 address with DNS via avahi-publish. The problem that we realize redis connect via redis-cli takes much time(several seconds). The root cause is hiredis first looks for IPv4 address of the DNS, than looks for IPv6 address. but due to system doesn't publish IPv4 address, It takes time(timeout) to failed to get IPv4 address.
So can hints.ai_family be set AF_UNSPEC instead of try IPv4 and IPv6 in order?
The text was updated successfully, but these errors were encountered: