cURL / Mailing Lists / curl-library / Single Mail

curl-library

problems with timeout catching

From: Roch Mangenot <roch.mangenot_at_netcentrex.net>
Date: Wed, 31 Dec 2003 16:25:27 +0100

I have a problem with libcurl and timeouts in a multithreaded application.
My problem is that sometimes a easyhandle seems not to catch the timeout (or
the timeout is not sent to it ?) and I end up with a thread blocked, that
never returns from the curl_easy_perform if the server is too slow, do not
relpy or the request is lost in the network's deep void... no timeout, no
errors. This problem seems to happen only when the load is heavy and many
handles are running simultaneously.

Is there a known problem with timeouts and multithreaded applications (using
CURLOPT_NOSIGNAL) ?

I am using libcurl 7.10.8 in an application performing 20 to 30 HTTP
requests /sec using the easy interface multithreaded. The application is
coded in C and objective C and running under linux redhat 6.2. I have 10 to
30 threads each managing one easy handle and setting timeout (from 1 to 10
secs) to ensure prompt answer to the users of this application.

could anyone help me sort this problem out or point me in a direction that
migth lead to a solution ?
I am currently trying to identify the blocked thread and wildly cancel it,
cleanup the easy_handle and restart the whole... but I dont like that much.

I dont realy know how libcurl handles timeouts but before digging into the
code to see if I can find a solution I would like any advice you could give
me.

Thanks
Roch Mangenot

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-31