httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James H. Cloos Jr." <cl...@jhcloos.com>
Subject Re: More on child-process just running (chewing CPU)
Date Tue, 02 Apr 1996 08:05:04 GMT
I just did a strace(1) on a spinning child.  It is running a loop of
alarm(2) calls w/ an arg of 4000, which is returning 4000.  The loop
is taking less than a ms to complete, therefor each call to alarm(2)
indicates that the last call had set the timer to timeout 4000s hence.

4000 is of course the timeout value as opposed to the keep alive timeout.

Timeout() itself doesn't call alarm(2), so this means that one or more
of the following are being called in quick succession:

	hard_timeout() w/ the req_rec's connection->keptalive=0

	soft_timeout()

	reset_timeout() w/ timeout_name !=0

I'm compiling right now with a signal(SIGPIPE,SIG_IGN) added to
timeout().  

Hmmm.  send_fd() calls bwrite() to send output.  bwrite() returns the
number of octets sent or -1 if 0 are sent.  After calling bwrite(),
send_fd() calls reset_timeout() iff bwrite() returned anything other
than 0.  Sounds like a likely place for the error, eh?


How about changing send_fd() from:

------------------------------------------------------------

        while(n && !r->connection->aborted) {
            w=bwrite(c->client, &buf[o], n);
            if (w)
                reset_timeout(r); /* reset timeout after successfule write */
            n-=w;
            o+=w;
        }

------------------------------------------------------------

to:

------------------------------------------------------------

        while(n && !r->connection->aborted) {
            w=bwrite(c->client, &buf[o], n);
            if (w>0)
                reset_timeout(r); /* reset timeout after successfule write */
            n-=w;
            o+=w;
        }

------------------------------------------------------------

Comments?

-JimC
-- 
James H. Cloos, Jr.	<URL:http://www.jhcloos.com/~cloos/>
cloos@jhcloos.com	Work: cloos@io.com
LPF,Usenix,SAGE,ISOC

Mime
View raw message