perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: PerlChildInitHandler => s/VOID/RUN_ALL/
Date Thu, 08 Sep 2005 00:35:55 GMT
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).


> 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
>>> you want to shut httpd down if a PerlChildExitHandler fails?  these
>>>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     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message