Trey Hyde wrote:
My PerlCleanupHandler seems to be firing before the content phase has
finished processing the page.

The handler pretty much looks like

sub handler {
my ($r) = @_;

undef $Foo::bar;
undef $Foo::baz;

return OK;
}

It's being invoked in a virtual host apache conf segment with
PerlCleanupHandler Apache::CleanupFoo

If I don't comment out the PerlCleanupHandler line pieces of the
application that rely on any variable that I undef in the Cleanup phase
will crash. In the error log it doesn't _LOOK_ like the handler is being called
early. The log yields exactly what I would expect it to.


PID 1000 REWRITE CALLED initial: 1 main: 0
PID 1000 REWRITE CALLED initial: 0 main: 0
PID 1000 REWRITE CALLED initial: 0 main: 1
PID 1000 AUTHENTICATION CALLED
BUNCH OF PERL ERRORS GO HERE (can't call method foo on undefined value
and the like)
PID 1000 REWRITE CALLED initial:0 main: 1 (rewriting
/cgi-bin/error/error.pl)
PID 1000 LOGGER CALLED (uri: error.pl)
PID 1000 CLEANUP CALLED (uri: mod_perl app)

I'm running on Apache/1.3.27 (Unix) mod_perl/1.26 w/ embperl 1.3.6.

Does anyone have an idea of what is going on here (or what I'm doing
wrong here?).  Am I right in thinking that the CleanupHandler isn't
supposed to have any effect on the code _running_ in the current or
subsequent processes?   In summary, leave Cleanup handler in everything
that I undef in the  cleanup handler gets undef'ed in the middle of
running the code, if I removed the CleanupHandler the app works as
intended.

In the current request the CleanupHandler happens the last. You can visually see that using Apache::ShowRequest
http://search.cpan.org/author/DOUGM/Apache-Module-0.11/lib/Apache/ShowRequest.pm


However you don't show the code that you have the problem with, so certainly we have no clue why does it fail. If your cleanup handler affects global variable in the package, certainly you may have an impact on the subsequent requests running in the same process.

If you still have this problem, reduce the problematic code to the very minimum (2-3 lines of code?), so that the problem can be still reproduced and post it here.

__________________________________________________________________
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



Reply via email to