Facing issue in dns timeout

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Tue Feb 2 19:05:24 UTC 2010


On Tue, Feb 02, 2010 at 03:37:09PM +0100, Denys Vlasenko wrote:
>>>> > configurable paramater according to the resolv.conf file man pages, for
>>>> the
>>>> > timeout:n and attempts:n in the next releases.

>> 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?
>
>Looks correct.
>
>-               reply_timeout = RES_TIMEOUT * 1000;
>+               reply_timeout = _RES_RETRANS * 1000;
>
>Since we don't care about precision here, you may well
>use   reply_timeout = _RES_RETRANS * 1024   :)

I didn't look, why would be 1024 superiour to 1000 (i don't like the
skew this would introduce for odd timeout:999 or the like)

Either way, perhaps you want to apply the thing if you think it makes
sense and is benefical to more than just yathish -- TIA :)

>10 sec timeout will be 10.24 sec, nobody cares.
>Just don't forget to also use "reply_timeout -= 1024"
>a bit further, -= 1000 would break logic which expects
>reply_timeout to reach (not overshoot) zero.


More information about the uClibc mailing list