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.

Re: Question about DNS timeout in libCurl

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 10 Dec 2021 23:34:56 +0100 (CET)

On Fri, 10 Dec 2021, Dmitry Karpov via curl-library wrote:

> While parallel query requests in c-ares are not there yet, I am wondering if
> it is possible to control DNS timeout or expose such control via curl handle
> options in the future? I noticed that libcurl always uses the default c-ares
> timeout value, which is 5s, and happy eyeball DNS timeout also relies on
> that value by hard coding it in the HAPPY_EYEBALLS_DNS_TIMEOUT constant, but
> in some cases, 5s may be a too long wait before switching to a different
> name server.

I agree that 5 seconds is a very long time that should probably be lowered,
but that timeout logic in curl is also only used when an old c-ares version is
used so maybe the effort is better spent elsewhere anyway?

> I am wondering, if you think that doing such changes will be a very risky
> change even as a short-term solution?

I don't think it will be particularly risky, no. I also think we should be
able to lower the default timeout somewhat. I do however think that this is
mostly a problem for c-ares itself to handle. I mean, we don't set any
timeout values at all when we use libc's resolver functions...

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-12-10