curl-library
Re: Download program hangs occasionally
Date: Mon, 28 Aug 2006 15:30:26 -0700
On Mon, Aug 28, 2006 at 11:34:53PM +0200, Rune Kleveland wrote:
> But sometimes the program seems to hang for 2-30 seconds. I would
> like to avoid that, since it slows down the monitoring process.
>
> The backtrace when it hangs looks like (modulo variations in url)
>
> (gdb) bt
> #0 0x00000031da6c117f in poll () from /lib64/libc.so.6
> #1 0x00000031dcf08dcb in __libc_res_nsend () from /lib64/libresolv.so.2
> #2 0x00000031dcf07fe5 in __libc_res_nquery () from /lib64/libresolv.so.2
> #3 0x00000031dcf08298 in __libc_res_nquerydomain () from /lib64/libresolv.so.2
> #4 0x00000031dcf08680 in __libc_res_nsearch () from /lib64/libresolv.so.2
> #5 0x00002aaaae241712 in _nss_dns_gethostbyname3_r ()
> from /lib64/libnss_dns.so.2
> #6 0x00002aaaae2419a4 in _nss_dns_gethostbyname2_r ()
> from /lib64/libnss_dns.so.2
> #7 0x00000031da6b4909 in gaih_inet () from /lib64/libc.so.6
> #8 0x00000031da6b4e43 in getaddrinfo () from /lib64/libc.so.6
The backtrace shows it's hanging during the DNS lookup phase, indicating that
there's a problem communicating with the DNS server to resolve the IP address
of the host. If you're concerned about the delay in connecting to this
particulate site, you could install a local caching nameserver and play some
tricks with it to use the cached local data when the remote server goes
down temporarily. If you're concerned with the DNS lookup hanging the OTHER
transfers, you need to recompile curl to use c-ares and do asynchronous DNS
lookups. You didn't say which version of curl you're using, but you may
need to upgrade to get support for ares.
>>> Dan
-- http://www.MoveAnnouncer.com The web change of address service Let webmasters know that your web site has movedReceived on 2006-08-29