Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 45578 invoked from network); 10 Jun 2004 21:27:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Jun 2004 21:27:10 -0000 Received: (qmail 81225 invoked by uid 500); 10 Jun 2004 21:27:14 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 81090 invoked by uid 500); 10 Jun 2004 21:27:13 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 81077 invoked by uid 99); 10 Jun 2004 21:27:13 -0000 Message-ID: <40C8D200.20303@netrition.com> Date: Thu, 10 Jun 2004 17:26:24 -0400 From: Jim Albert Organization: Netrition - The Internet's Premier Nutrition Superstore! User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stas Bekman CC: modperl@perl.apache.org Subject: Re: mod_perl2 timely catching SIGPIPE References: <40C78206.7040701@netrition.com> <40C82819.5060400@stason.org> In-Reply-To: <40C82819.5060400@stason.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Netrition-MailScanner-Information: Please contact the ISP for more information X-Netrition-MailScanner: Found to be clean X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Stas Bekman wrote: > Jim Albert wrote: > >> I'm trying to determine how to have my mod_perl apache server properly >> catch a SIGPIPE signal in a timely manner. >> >> My environment is Apache/2.0.49 (Fedora) and mod_perl 2. > > > Jim, please *always* report bugs and problems following these guidelines! > http://perl.apache.org/bugs/ > and save yourself and us time. Thank you! > >> In my conf.d/perl.conf file I have the following: >> PerlFixupHandler Apache::SIG2 > > [...] > >> Under Apache/1.3.27 and mod_perl/1.27 I had a very similar >> PerlFixupHandler in place (a slightly modified Apache::SIG.pm) to >> catch a SIGPIPE and the SIGPIPE was caught and my signal handler >> executed at the correct time... when the connection was broken by the >> browser. I would like to be able to continue to catch a SIGPIPE like >> this under Apache2/modperl2. Can anyone offer any suggestions as to >> how to get my signal handler, PIPE, executed as soon as the SIGPIPE is >> generated? > > > What perl version are you using now (and which one have you used with > 1.3.x?) (which you were supposed to sent as a part of the bug report). In my mod_perl environment (Apache 1.3 / mod_perl 1.27) where my perl handler catches and immediately handles the SIGPIPE I am using perl 5.6.1. In my mod_perl environment (Apache2.0.49 / mod_perl 2) where my perl handler properly catches the SIGPIPE, but does not handle it immediately I am using perl 5.8.3. > I > don't think this has anything to do with what mod_perl version you are > using. > > Starting from 5.8.0 perl delays signal delivery, making signals safe. [...] Stas, you are absolutely correct... thanks a lot! I added the following line to my server_startup.pl (Apache2.0.49 / mod_perl 2) which gets included from my conf.d/perl.conf file: $ENV{PERL_SIGNALS} = "unsafe"; With that line in place, my PerlFixupHandler now catches a SIGPIPE and immediately executes the SIGPIPE signal handler. I hadn't had any significant problem that I noticed using "unsafe" signals in the past and I need the functionality that "unsafe" signals provide me, so I'm going to go with "unsafe" signals in my apache2/mod_perl2/perl5.8 environment. > Please let us know which technique has worked for you and it'd be great > to have a section documenting this area, including full examples as in > your original bug report. I've been researching this problem for several days so I'm anxious to get an Apache2/mod_perl2 system into production now that I have a solution. When I get some time I'll post a detailed explanation of this problem with examples to this mailing list. Jim Albert -- 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