httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 23528] - httpd hangs for 300 sec with apr_bucket_read failed.
Date Wed, 04 Feb 2004 20:35:22 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23528>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23528

httpd hangs for 300 sec with apr_bucket_read failed.





------- Additional Comments From fbujanic@fikus.com  2004-02-04 20:35 -------
I have several apache 2.0.48 servers exhibiting the
"ap_content_length_filter:  apr_bucket_read() failed" problem with little
bit of poking around I found that this happens avery time apache is
waiting for a large amount of data to be returned to it from the cgi
script (eg. large and time consuming database read/write or extensive
writing to stderr). This happens on both 32 and 64 bit (Linux and Solaris)
platform but only in the preforked mpm model, the worker (threaded) mpm
seems to handle this problem better.

I did couple of straces to my cgi script and it always gets stuck in the
write system call and at the same time the corresponding http server is
stuck in poll system call. this lasts for (5 min) 'Timeout 300' and the
error is displayed inside the error_log file

(70007)The timeout specified has expired: ap_content_length_filter:
apr_bucket_read() failed

and the cgi script either dies or becomes a zombie process.

If I am correct error is coming from httpd-2.0.48/server/protocol.c file,
(snippet included below) and has to do with BLOCK_READ vs. NONBLOCK_READ.
I might be totally wrong about this guess but....

Hope you have a fix for this bug or maybe an idea how I could work around
it.

thanks
fil

    /* Loop through this set of buckets to compute their length
     */
    e = APR_BRIGADE_FIRST(b);
    while (e != APR_BRIGADE_SENTINEL(b)) {
        if (APR_BUCKET_IS_EOS(e)) {
            eos = 1;
            break;
        }
        if (e->length == (apr_size_t)-1) {
            apr_size_t len;
            const char *ignored;
            apr_status_t rv;

            /* This is probably a pipe bucket.  Send everything
             * prior to this, and then read the data for this bucket.
             */
            rv = apr_bucket_read(e, &ignored, &len, eblock);
            if (rv == APR_SUCCESS) {
                /* Attempt a nonblocking read next time through */
                eblock = APR_NONBLOCK_READ;
                r->bytes_sent += len;
            }
            else if (APR_STATUS_IS_EAGAIN(rv)) {
                /* Output everything prior to this bucket, and then
                 * do a blocking read on the next batch.
                 */
                if (e != APR_BRIGADE_FIRST(b)) {
                    apr_bucket_brigade *split = apr_brigade_split(b, e);
                    apr_bucket *flush =
apr_bucket_flush_create(r->connection->bucket_alloc);

                    APR_BRIGADE_INSERT_TAIL(b, flush);
                    rv = ap_pass_brigade(f->next, b);
                    if (rv != APR_SUCCESS || f->c->aborted) {
                        apr_brigade_destroy(split);
                        return rv;
                    }
                    b = split;
                    e = APR_BRIGADE_FIRST(b);

                    ctx->data_sent = 1;
                }
                eblock = APR_BLOCK_READ;
                continue;
            }
            else {
                ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                              "ap_content_length_filter: "
                              "apr_bucket_read() failed");
                return rv;
            }
        }
        else {
            r->bytes_sent += e->length;
        }
        e = APR_BUCKET_NEXT(e);
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message