Facing issue in dns timeout

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Jan 29 19:07:04 UTC 2010


On Fri, Jan 29, 2010 at 11:55:18AM +0530, yathish chandru wrote:
>Ok, Thanks :)

Please do not top-post.
>
>On Fri, Jan 29, 2010 at 11:42 AM, Khem Raj <raj.khem at gmail.com> wrote:
>
>> On Thu, Jan 28, 2010 at 9:45 PM, yathish chandru
>> <yathish.anshu at gmail.com> wrote:
>> > Thanks for the quick response Raj. Now,is there any plan to make it as
>> > configurable paramater according to the resolv.conf file man pages, for
>> the
>> > timeout:n and attempts:n in the next releases.
>>
>> I am not aware of any effort. But patches are welcome.
>>
>> > Thanks for the support.
>> >
>> > Regards
>> > Yathish
>> >
>> > On Thu, Jan 28, 2010 at 11:49 PM, Khem Raj <raj.khem at gmail.com> wrote:
>> >
>> >>  On (28/01/10 21:30), yathish chandru wrote:
>> >> > Hi All,
>> >> >
>> >> > I'm presently using uClibc-0.9.28.2 , in that the proble facing when I
>> >> make
>> >> > a call for getaddrinfo().
>> >> >
>> >> > Occasionaly the DNS server is taking long DNS response, so after
>> >> verifying
>> >> > the resolv.c file,
>> >> >
>> >> > Found that getaddrinfo,uClibc library and we found that it is hard
>> coded
>> >> to
>> >> > 10 Seconds. Attaching the file resolv.c from uclibc.
>> >> > Please look at the function __dns_lookup() and grep for REPLY_TIMEOUT,
>> so
>> >> in
>> >> > the function is in loop for MAX_RETRIES with REPLY_TIMOUT in the
>> select
>> >> > posix call.
>> >> > So, since the  REPLY_TIMEOUT is hard coded, and I didn't find any
>> >> function
>> >> > to override the timeout. To reduce the timeout we need to recompile
>> >> UClibc
>> >> > library.
>> >> >  So, the RES_TIMEOUT which is avalable in resolv.conf is of no use.
>> >> > Since, the problem in our application is the first dns request in
>> >> > getaddrinfo is failing and the second one passes, so wanted to retry
>> by
>> >> > reducing the timeout but foud no option.
>> >> > Is this the same behaviour in lthe latest uclibc. Please let us know
>> on
>> >> this
>> >> > issue.
>> >>
>> >> now it has been reduced to 5sec but is still hardcoded. For resolv.conf
>> >> I only see 'domain', 'search' and 'nameserver' keywords being handled so
>> >> timeout:n may not work

options are not implemented, as khem said.
If somebody can proof-read attached patch then we could install it to
master iff somebody else thinks it's benefical overall.

Two notes: First, it's completely untested and second it's probably a bit
bloated for what it does, i guess (reimplementations welcome). Stats:

bloat-o-meter lib.old/libuClibc-0.9.30-git.so lib/libuClibc-0.9.30-git.so 
function                                             old     new   delta
__open_nameservers                                   986    1121    +135
__dns_lookup                                        1812    1841     +29
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 164/0)             Total: 164 bytes

Opinions?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: resolv.conf-options.00.patch
Type: text/x-diff
Size: 2335 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20100129/dc76976d/attachment.bin>


More information about the uClibc mailing list