Stas Bekman wrote:
I'm working on various END block issues. One of the problems is that at the moment any END blocks encountered during the perl-script response handler (.e.g when a module gets loaded for the first time) are simply dropped on the floor. The only END blocks that are run, are those from registry handlers, which don't have a package declaration.
I'm thinking that the right solution is to move them to PL_endav so that they will be executed when the interpreter exits.
this sounds right. I would expect BEGIN blocks to execute when the module is loaded in an interpreter and END block when the interpreter is torn down, giving a balance that corresponds to the command line invocation of the interpreter.
Thanks Geoff.
The issue is problematic, since at the moment, child processes don't run
any perl_destruct finalizations. I don't know why Doug has programmed it to be that way, as there are no comments:
mod_perl.c:
if ((level = getenv("PERL_DESTRUCT_LEVEL"))) {
modperl_destruct_level = atoi(level);
}
else {
/* default to no teardown in the children */
modperl_destruct_level = 0;
}modperl_destruct_level = 1;
if (modperl_destruct_level) {
apr_pool_clear(server_pool);
}The only solution I can think of is to manually traverse any perl interpreters that are still running and run the END blocks stored in PL_modglobal.
The main problem with shutdown logic is that SIGKILL (sent during apachectl stop) will kill the server before it had a chance to finish the run of registered pool cleanup handlers. This probably was the reason Doug coded it to skip the destruction of all, but the parent perls.
__________________________________________________________________ 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
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
