Dan Wilga wrote:
At 10:55 AM -0700 8/1/04, Stas Bekman wrote:

--- ModPerl-Registry/lib/ModPerl/RegistryCooker.pm 27 Jun 2004 21:26:45 -0000 1.50
+++ ModPerl-Registry/lib/ModPerl/RegistryCooker.pm 1 Aug 2004 17:52:00 -0000
@@ -42,6 +42,7 @@
use File::Basename;


 use Apache::Const  -compile => qw(:common &OPT_EXECCGI);
+use APR::Const     -compile => qw(ECONNABORTED);
 use ModPerl::Const -compile => 'EXIT';

 unless (defined $ModPerl::Registry::MarkLine) {
@@ -724,9 +725,14 @@
     # ModPerl::Util::exit() throws an exception object whose rc is
     # ModPerl::EXIT
     # (see modperl_perl_exit() and modperl_errsv() C functions)
-    if ($@ && !(ref $@ eq 'APR::Error' && $@ == ModPerl::EXIT)) {
-        $self->log_error($@);
-        return Apache::SERVER_ERROR;
+    if ($@) {
+        if ($@ == APR::ECONNABORTED) {
+            # silently ignore client connection abort
+        }
+        elsif (!(ref $@ eq 'APR::Error' && $@ == ModPerl::EXIT)) {
+            $self->log_error($@);
+            return Apache::SERVER_ERROR;
+        }
     }
     return Apache::OK;
 }


Not quite--now I get this:

[Mon Aug 02 13:59:29 2004] [error] [client [ip address]] Argument "Software caused connection abort at [script path]" isn't numeric in numeric eq (==) at /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/ModPerl/RegistryCooker.pm line 723, <IN> line 20.\n, referer: [referring page]

I guess the problem is that, unlike $!, $@ doesn't have a numeric component. I tried changing this to:

+    if ($@) {
+        if ($@ eq APR::ECONNABORTED) {
+            # silently ignore client connection abort

but that didn't help. Now it says, "APR::Error: Can't handle 'eq' at /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/APR/Error.pm line 39, <IN> line 20.\n".

Next idea? :-)

Ah, OK, APR::Error exception has got stringified already when it reached that code. Well, really the fix shouldn't be there. This is going to hit any modperl handlers, not only registry. So we should have a better solution.


In mod_perl 1, many API calls were silently failing, so those broken connection failures were silent. In mp2, it's the other way around - no failure go unnoticed, unless you code it to be so.

Are you sure you want to ignore those things? I suppose that should be the case.

To start with I want to have a short test case that I can reproduce the problem with. Too bad you had it happening only over SSL. We need to check the Apache source to see, who else sends APR__ECONNABORTED and hopefully have a simpler test. do you know if you were hitting it on the reading of the request or sending the response?

Add the following:

use APR::Error;
$SIG{__DIE__} = \&APR::Error::confess;

in your startup.pl, so now the trace will show you which line in the code it has failed in.

--
__________________________________________________________________
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

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to