cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: A couple of handles stuck in WAITDO state?

From: <johansen_at_opensolaris.org>
Date: Mon, 14 Jun 2010 11:03:19 -0700

On Sat, Jun 12, 2010 at 09:30:12PM +0200, Daniel Stenberg wrote:
> My first suggested progress callback patch:
>
> diff --git a/lib/multi.c b/lib/multi.c
> index 9abf339..f210dcf 100644
> --- a/lib/multi.c
> +++ b/lib/multi.c
> @@ -1528,6 +1528,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
>
> multistate(easy, CURLM_STATE_COMPLETED);
> }
> + else
> + Curl_pgrsUpdate(easy->easy_conn);
> }
> } while(0);
> if((CURLM_STATE_COMPLETED == easy->state) && !easy->msg) {

Thanks, I'll give this a try. I have a patch for you now, too.
I applied this to a machine that was reproducibly getting its handles
stuck in WAITDO. I ran an install loop over the weekend, and so far no
instances got stuck. Network load is higher during business hours. I'm
letting the test run some more. I'll let you know if I see any problems
with this patch.

--- lib/multi.c 2010-06-11 18:25:39.000000000 -0700
+++ lib/multi.c 2010-06-11 19:25:31.187050782 -0700
@@ -2127,11 +2127,13 @@ static int update_timer(struct Curl_mult
 
 static CURLcode addHandleToSendOrPendPipeline(struct SessionHandle *handle,
                                               struct connectdata *conn)
 {
   size_t pipeLen = conn->send_pipe->size + conn->recv_pipe->size;
+ struct curl_llist_element *sendhead = conn->send_pipe->head;
   struct curl_llist *pipeline;
+ CURLcode rc;
 
   if(!Curl_isPipeliningEnabled(handle) ||
      pipeLen == 0)
     pipeline = conn->send_pipe;
   else {
@@ -2140,11 +2142,21 @@ static CURLcode addHandleToSendOrPendPip
       pipeline = conn->send_pipe;
     else
       pipeline = conn->pend_pipe;
   }
 
- return Curl_addHandleToPipeline(handle, pipeline);
+ rc = Curl_addHandleToPipeline(handle, pipeline);
+
+ if (pipeline == conn->send_pipe && sendhead != conn->send_pipe->head) {
+ /* this is a new one as head, expire it */
+ conn->writechannel_inuse = FALSE; /* not in use yet */
+ infof(conn->data, "%p is at send pipe head!\n",
+ conn->send_pipe->head->ptr);
+ Curl_expire(conn->send_pipe->head->ptr, 1);
+ }
+
+ return rc;
 }
 
 static int checkPendPipeline(struct connectdata *conn)
 {
   int result = 0;

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-06-14