You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 2001/04/09 00:42:05 UTC

HTTP_IN filter problems

Hi all,

The HTTP proxy uses the HTTP_IN filter to read from the network. The
proxy code seems to be working fine, however about 10% to 20% of
requests fail with this error:

  [error] (9)Bad file descriptor: apr_bucket_read

The error occurs part of the way through a read from the remote server,
and sometimes results in a partially loaded graphic or page, or
sometimes no graphic or page at all.

The error is generated by this piece of code in ap_http_filter():

  e = APR_BRIGADE_FIRST(ctx->b);
  if ((rv = apr_bucket_read(e, &ignore, &len, mode)) != APR_SUCCESS) {
      /* probably APR_IS_EAGAIN(rv); socket state isn't correct;
        * remove log once we get this squared away */
      ap_log_error(APLOG_MARK, APLOG_ERR, rv, f->c->base_server, 
                   "apr_bucket_read");
      return rv;
  }

The HTTP_IN filter is normally used for reading client requests off of
the network. In theory, if this error exists in HTTP_IN it means that
about 10% to 20% of client POST requests are likely to fail.

Does this error ring any bells with anyone?

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."


Re: HTTP_IN filter problems

Posted by Graham Leggett <mi...@sharp.fm>.
rbb@covalent.net wrote:

> >   [error] (9)Bad file descriptor: apr_bucket_read

> Sounds like your apr_socket_t is created with the wrong pool.  If you are
> dealing with keepalives, then you need to be sure that the socket is
> created with the correct pool.

Everything is created out of c->pool, and the error is happening when
keepalives are off (using my HTTP/1.0 Netscape v4.7), ie brand new
c->pool per connection. The error only happens when I access sites on
the internet (other side of a dialup link) - I've tested proxied sites
on 127.0.0.1 using ab - not a single error at all.

I've been checking pools for the last few days with no luck - are you
sure this is a pool thing?

Will carry on checking in the meantime - it's a real nasty one...

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: HTTP_IN filter problems

Posted by rb...@covalent.net.
On Mon, 9 Apr 2001, Graham Leggett wrote:

> Hi all,
>
> The HTTP proxy uses the HTTP_IN filter to read from the network. The
> proxy code seems to be working fine, however about 10% to 20% of
> requests fail with this error:
>
>   [error] (9)Bad file descriptor: apr_bucket_read
>
> The error occurs part of the way through a read from the remote server,
> and sometimes results in a partially loaded graphic or page, or
> sometimes no graphic or page at all.
>
> The error is generated by this piece of code in ap_http_filter():
>
>   e = APR_BRIGADE_FIRST(ctx->b);
>   if ((rv = apr_bucket_read(e, &ignore, &len, mode)) != APR_SUCCESS) {
>       /* probably APR_IS_EAGAIN(rv); socket state isn't correct;
>         * remove log once we get this squared away */
>       ap_log_error(APLOG_MARK, APLOG_ERR, rv, f->c->base_server,
>                    "apr_bucket_read");
>       return rv;
>   }
>
> The HTTP_IN filter is normally used for reading client requests off of
> the network. In theory, if this error exists in HTTP_IN it means that
> about 10% to 20% of client POST requests are likely to fail.
>
> Does this error ring any bells with anyone?

Sounds like your apr_socket_t is created with the wrong pool.  If you are
dealing with keepalives, then you need to be sure that the socket is
created with the correct pool.

Ryan


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------