cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: DNS lookup freezes easy handles (multi interface)

From: Emil Romanus <emil.romanus_at_gmail.com>
Date: Mon, 19 May 2008 20:59:22 +0200

2008/5/19 Daniel Stenberg <daniel_at_haxx.se>:
> On Mon, 19 May 2008, Emil Romanus wrote:
>> * 5 handles are added, each pointing to the same host
>> * DNS lookup is started by the first one
>> * The 4 others are put in a WAITDO state (not sure, but so it seems)
>> * DNS lookup completes, first handle continues and completes transfer
>
> I assume you're now talking 7.18.1 with pipelining enabled? I'm not
> currently testing that case since I have my described problems already
> without pipelining and getting them sorted first feels like a good idea to
> me.
>

Yes, that was with 7.18.1, pipelining enabled.

>
>> If curl_multi_socket_all() is never called, or curl_multi_socket() isn't
>> called due to timeout, then attention will *never* be given to the 4 waiting
>> handles.
>
> No, that logic doesn't hold. The case when you call curl_multi_socket() due
> to a timeout is exactly the same as when you call curl_multi_socket() due to
> a socket action, with the only difference that there isn't the primary
> socket to check. All calls to the curl_multi_socket*() functions will check
> the timer tree for handles that have timed out and need action done.
>

I get your point, but in this case it will not work because of the
bug. If the first handle gets done, and if there is no timeout and I
don't call curl_multi_socket_all(), the 4 waiting handles will never
wake up (and since they have no active sockets, no socket-events will
occur). This is a part of the problem, since they get stuck in the
WAITDO state, and I will try to take at look at it tomorrow while you
are having a look at the bugs when pipelining is disabled as you
described.

>
> They're added to linked lists (one for sendind and one for receiving). See
> addHandleToSendOrPendPipeline() for send_pipe and recv_pipe stuff.
>

Thanks, I'll see what I can do.

Emil
Received on 2008-05-19