perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: :Apache2 IO flush: (103) Software caused connection abort
Date Mon, 08 Aug 2005 05:40:03 GMT
tony@clearfox.com wrote:
> 
> I have been getting some strange error on my system lately, so I took 
> the time to completely upgrade my server last night to see of I could 
> fix the problem with new updates. First thing this morning the errors 
> re-surfaced.
> 
> The error I'm getting is
> 
> :Apache2 IO flush: (103) Software caused connection abort at 
> /pathtosite/admin.sd line 1136,

[...]
> Now, about the error, at line 1136 of admin.sd is this line.
> 
> print $html;

As you are using perlio layers (i.e. print() and not $r->print()), the 
error comes from:

src/modules/perl/modperl_io_apache.c:174:      ":Apache2 IO flush");

where it tries to flush the current STDOUT filehandle:

     MP_RUN_CROAK(modperl_wbucket_flush(rcfg->wbucket, FALSE),
                  ":Apache2 IO flush");

You can eval { } that print statement and deal with the exception, as 
explained here:
http://perl.apache.org/docs/2.0/api/APR/Error.html#Description

> The problem is, the :Apache2 IO flush: error is getting reported, but 
> the user see's no error. error.osn should present an html page stating 
> the error was reported and will be taken care of. Instead the page 
> successfully renders and send me an error. Sending an email when no 
> error is presented to the user also slows that request.

Are you saying that the exception is ignored by perl and the code 
continues to run just fine? I doubt this is the case. I think what happens 
is that the data is sent to the client and then for some reason the flush 
fails to finish, but the user has already received all the data. Probably 
due to your errordocument setup, the user doesn't get to see the error.

Again the error most likely happens at the very end of the response 
sending. May be the client disconnects too fast, before mod_perl had the 
chance to make sure that the buffers are empty. but it looks like some 
data must be present in the buffer for this condition to happen, as:

MP_INLINE apr_status_t modperl_wbucket_flush(modperl_wbucket_t *wb,
                                              int add_flush_bucket)
{
     apr_status_t rv = APR_SUCCESS;

     if (wb->outcnt) {
         rv = modperl_wbucket_pass(wb, wb->outbuf, wb->outcnt,
                                   add_flush_bucket);
     }
    [...]
     return rv;
}

i.e.  wb->outcnt returns true. you could probably add some debug to 
modperl_wbucket_pass to see what's inside the buffer when it fails to flush.

> Can anyone help? If not, I'm going to open a bug report to Apache.

I doubt it has anything to do with Apache. Either try to play with the 
above suggestions, or we'll need a test case we can reproduce the problem 
with.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message