Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 24415 invoked from network); 8 Sep 2005 00:35:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Sep 2005 00:35:31 -0000 Received: (qmail 35995 invoked by uid 500); 8 Sep 2005 00:35:31 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 35984 invoked by uid 500); 8 Sep 2005 00:35:31 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 35971 invoked by uid 99); 8 Sep 2005 00:35:31 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2005 17:35:31 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [195.80.154.36] (HELO mail.logilune.com) (195.80.154.36) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2005 17:35:44 -0700 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id F39E5D6956; Thu, 8 Sep 2005 02:35:26 +0200 (CEST) Message-ID: <431F876B.9000105@stason.org> Date: Wed, 07 Sep 2005 17:35:55 -0700 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.11) Gecko/20050730 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: Geoffrey Young CC: mod_perl Dev Subject: Re: PerlChildInitHandler => s/VOID/RUN_ALL/ References: <431F7486.6050204@stason.org> <431F7D85.2060802@modperlcookbook.org> <431F8247.9050201@stason.org> <431F8485.2090909@modperlcookbook.org> In-Reply-To: <431F8485.2090909@modperlcookbook.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Geoffrey Young wrote: >>It doesn't work in Child(Init|Exit) phases. Not only it doesn't exit, it >>doesn't even log the error. See the test in my patch. Add die in >>child_init() and you will see. > > > ok, that's problematic - anyplace you call die() from perl-land ought to > show up in the logs. the current behavior is bad (tm). Right. > but if by exit you mean stop server startup, are you sure that's possible > within the confines of httpd? in prefork you might get no children ever > available to receive requests, but I'm not sure that you could make > apachectl return an error. are you? That's why I ask. But not exiting is not an option. Not everybody checks error_log for problems, and some people have too much noise in those files to see something useful. >>The fact that httpd ignores the child_init() return value is a problem >>that needs to be fixed. > > > ok. and we can theoretically not ignore it in mod_perl-land. but what do > we do from it? we can issue croaks all day, but can we make httpd startup > stop within the child_init() callback currently? I know, hence the question. I suppose the only option is to fix httpd. Why httpd aborts on errors during the config, open_logs or post_config phase, but not child_init? It sounds like an emission to me, since child_init is very similar to any of preceeding to it phases. >>>>The only problem I have is how to prevent from Apache to continue on >>>>failure. Any ideas? >>> >>> >>> >>>I'm not sure that it makes sense to halt apache on failure in these >>>phases. >>> you want to shut httpd down if a PerlChildExitHandler fails? these >>>aren't >>>part of startup processing so I don't see how they could prevent >>>apache from >>> starting. >> >> >>While I somewhat agree about ChildExit, but not about ChildInit. I'm not >>talking hypotethically. I want to use ChildInit for efficiency reasons, >>and sometimes things fail, and I have no way to prevent the server from >>happily starting. > > > ok, but that's a httpd issue, not a mod_perl one, right? It's a mod_perl too, since at the moment die() called don't log their error messages in error_log, but are simply ignored. (again see my test). > again, unless > httpd gives us a mechanism to halt the startup process it's kinda out of our > hands. unless you're saying httpd has a formal mechanism in place we can > use. if it doesn't I'd say we either need to offer a patch to httpd and > make things right going forward, or live with what httpd gives us. I suppose the trickiness of this issue is that child_init runs in the child process. So in order to prevent the server from starting, it needs to somehow signal the problem to the parent problem, which given the multitude of MPMs (where I think the child_init is called from) it might be not so trivial. -- __________________________________________________________________ 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://mailchannels.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org