Geoffrey Young wrote:

Stas Bekman wrote:

At the moment Child(Init|Exit) phases are of type VOID, i.e. any
failures are ignored, which sucks, since you now can't do any reliable
initialization in the child init phase (e.g. let's say Apache::DBI's
child_init phase fails).


a call to die() shouldn't be ignored.  that's the typical way to exit from
void phases.

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.

It does work in filters.

How about making it RUN_ALL instead? The
immediate gain is that errors are now logged. I don't see any problems
with backwards compatibility, besides ChildInit phases needing to return
OK or DECLINED, but most likely there were all doing so anyway.


what's the rationale for making this phase RUN_ALL but leaving the other
VOID phases as is?  if die() works then there is an exit strategy for the
VOID phases.  if die() isn't logged, that's something we ought to fix, not
necessarily by changing the runtime prototype to RUN_ALL, though.

see above

also, I'm in favor of keeping these phases programmatically aligned with httpd.

The fact that httpd ignores the child_init() return value is a problem that needs to be fixed.

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.

The ChildExit is a whole different story, since httpd will kill the server w/o letting it complete its cleanup handlers, which I've reported like 4 years ago, but nobody wants to deal with that. The fact is, you can't do any reliable process shutdown cleanups in Apache/mod_perl at the moment. But let's not get offtopic on the other issue.

--
__________________________________________________________________
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://mailchannels.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to