Chris Faust wrote:
Ouch, in other words its going to be a tough on to track down :)..
Thanks Stas, I at least have some direction now.
what you could do is to go to the httpd source and change it to log the error. Look in modules/http/http_protocol.c:1884
/* We lose the failure code here. This is why ap_get_client_block should * not be used. */ if (rv != APR_SUCCESS) { /* if we actually fail here, we want to just return and * stop trying to read data from the client. */ r->connection->keepalive = AP_CONN_CLOSE; apr_brigade_destroy(bb); return -1; }
So log it there:
if (rv != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "read failed"); /* if we actually fail here, we want to just return and * stop trying to read data from the client. */ r->connection->keepalive = AP_CONN_CLOSE; apr_brigade_destroy(bb); return -1; }
-Chris
----- Original Message ----- From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Chris Faust" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, May 28, 2003 8:15 PM
Subject: Re: Apache Error of $r->read failed to read
Chris Faust wrote:loose.
Hi,
We have been having some problems where all of a sudden apache will start logging the error of:
[error] mod_perl: $r->read failed to read
Multiple times (100s in less then 10th of a sec), often it will get to the point where load on the machine goes through the roof and apache has problems responding and it appears to be the number of requests that are happening as limits that shouldn't be reached like DB connections and apache processes are maxing out during non-peak hours.
From what we could see it looked like someone outside was sending all kind of linefeeds and whatnot within the URL which was documented in the Apache 45 release which we did update - now we are down to getting the above mod_perl error and shortly after that starts all hell breaks
Nowhere in our code do we directly call the "read" method nor can I find anything relating to the error so I'm a little lost on what I can do.
Any ideas?
You probably use CGI.pm or something else that calls $r->read(). This
happends
in xs/Apache/RequestIO/Apache__RequestIO.h (hint grep the mod_perl source
code):
/* * XXX: as stated in ap_get_client_block, the real * error gets lots, so we only know that there was one */ ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "mod_perl: $r->read failed to read"); break;
As you can see from the comment due to a bad implementation of ap_get_client_block in Apache, the error is not available. I'm planning to rewrite all these functions to get rid of ap_get_client_block, and work
with
bucket brigades instead.
In any case that won't solve the problem that you are seeing, I'd dig in Apache. e.g. trying to use mod_cgi (which doesn't use ap_get_client_block)
to
reproduce the problem and ask at the httpd list.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com