curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Happy Eyeballs doesn't seem to work with c-ares when IPv6 name servers on top of the name server list don't respond

From: Dmitry Karpov via curl-library <curl-library_at_lists.haxx.se>
Date: Thu, 25 Nov 2021 02:12:33 +0000

Hello,

I am facing an issue with Happy Eyeballs in dual-stack mode when server list in resolv.conf starts from not responding IPv6 name servers like

IPv6 server1 <not responding>
IPv6 server2 <not responding>
IPv4 server1 <good>

IPv4 server N

In this case, it takes libcurl too long to start IPv4 connection (10s, in my example, 5s per IPv6 name server) even though the HET option is 200ms.

It seems the problem is that even though libcurl implements Happy Eyeballs for DNS queries and runs A and AAAA queries in parallel, c-ares still goes through the list of name servers as they are listed in the resolv.conf.

So, in badly functioning IPv6 environment, c-ares tries not responding IPv6 servers first and spends 5s (c-ares DNS query timeout) for each server until it reaches good IPv4 name servers and then connection goes through Happy Eyeballs and IPv4 connection gets running.

C-ares doesn’t seem to know anything about Happy Eyeballs, and it just goes blindly through the list of name servers.
It is driven by libcurl, so I am wondering if libcurl’s Happy Eyeballs mechanism implementation somehow missed potential problems with c-ares trying not responding IPv6 name resolution servers for too long?
Is it possible to work around this issue somehow?

Thanks,
Dmitry Karpov

-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-11-25