Dan Wilga wrote:
[...]
I have written to the Apache Developers' list, but the only suggestion I got was that the initial "Connection reset by peer" error is to be expected, but that mod_perl probably shouldn't be generating the pair of "[error]" level log messages.

I don't entirely buy this, since there was a behavior change when only Apache was upgraded (I kept the same mod_perl version when this started happening.) It also only happens when SSL is added to the mix.

However, if you do agree that mod_perl needs to be more tolerant of this particular condition then, in my opinion, not only should the error not be logged with the "[error]" severity, but the ErrorDocument 500 should also not be called.

Thanks for the detailed report, Dan. I'm not 100% sure it's a good idea to always ignore connection reset errors, since it may come in a different context (e.g. a registry script doing its own socket IO). But please give a try to this patch. I haven't tested it.


Index: ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
retrieving revision 1.50
diff -u -r1.50 RegistryCooker.pm
--- 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;
 }

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