perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Gunton <n...@nilspace.com>
Subject Re: Question re preloading embperl and apache shutdown
Date Thu, 24 Jul 2008 15:44:46 GMT
Andrew O'Brien wrote:
> Hi Neil,
> use Apache2::ServerUtil;
> # We want to do this only when the sever restarts. (The start process
> # includes a restart). The below variable has a value of 1 during
> # server start/stop and a value greater than one during the second
> # phase of server starting and any graceful restart.
> if ( Apache2::ServerUtil::restart_count() > 1 ) {
>   # force load/initialise perl stuff
> }
> 
> Are any of the following useful to you (even if you set a variable using
> the shutdown callback to forcibly stop the preload?) in
> Apache2::ServerUtil?
> 
>    # register server shutdown callback
>    Apache2::ServerUtil::server_shutdown_register_cleanup(sub {
> Apache2::Const::OK });
> 
>    # do something only when the server restarts
>    my $cnt = Apache2::ServerUtil::restart_count();
>    do_something_once() if $cnt > 1;

Apparently Embperl isn't simply calling the preload routine again at 
shutdown... for some reason, the httpd daemon is just sitting there 
hanging for 30 seconds or so at shutdown. I tried tracing to a log file, 
and the PreLoadFiles routine in Embperl wasn't being executed again at 
shutdown. So I don't know why the server hangs like that rather than 
just shutting down. It's got something to do with Embperl, though, 
because when I switch preloading off, it shuts down very quickly with no 
hang on that last process. A mystery.

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message