Subject: Re: C-ares timeout issue

Re: C-ares timeout issue

From: Tommie Gannert <tommie_at_spotify.com>
Date: Mon, 29 Nov 2010 09:46:21 +0100

Ben Greear wrote:
> On 11/09/2010 07:43 AM, Brian Yoder wrote:
>> One thing I did notice was that when a timeout is detected, the UDP
>> socket should not be closed. UDP is connection-less and oblivious to
>> whatever issues the server has. But if the UDP socket is closed and then
>> re-opened (which it shouldn't be), I wouldn't expect any subsequent
>> error to stick at ARES_ETIMEOUT.
>
> Can you sniff to see if any packets are sent after the timeout
> happens?
>
> Can you reproduce by yanking the ethernet cable at an appropriate
> time to cause a timeout, or maybe adding a network emulator
> such as netem to cause timeouts?
>
> An strace of the program after timeout happens might be nice.
Brian, have you pursued this further?

Regarding closing UDP sockets. You can't rebind a socket (if I understand
the man page correctly), so if you want to randomize ports, you'll have
to close/recreate it. And from recent year's injection attacks, I think you
do want to randomize ports.

-- 
Tommie Gannert

Received on 2010-11-29