perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: per-server cleanups core dump? geoff?
Date Tue, 30 Nov 2004 17:41:45 GMT
Geoffrey Young wrote:

> well, I was kind of wondering out loud if we needed to provide per-server
> cleanups like we did in mp1.
> the main reason we needed them (as far as I can see) was for performing
> cleanup work when a server was re-started.  but we may not need a special
> hook for this in mp2. consider the following (off the top of my head):
>   my $mtime = -M $httpd.conf;
>   sub handler {
>      ... uses $mtime ...
>   }
> now, in mp1 $mtime is calculated only on server start for common static
> builds.  it is not re-calculated on server restart unless you are using dso
> or PerlFreshRestart.  but httpd.conf might be edited between start and
> restart, so you would maintain an accurate mtime with something like
>   my $mtime = -M $httpd.conf;
>   Apache->server->register_cleanup(sub { $mtime = -M $httpd.conf });
> that was mp1.  but I seem to recall that the interpreter is _always_ broken
> down in mp2, in which case the initial example _will_ reset $mtime on each
> restart via PerlModule.  if this is true, then people could use a much
> simpler idiom to perform similar activities, such as initializing caches or
> whatnot.

Right, I'll write a test for that to make sure it really works.

> I'm not saying that we need or should abandon per-server cleanups, since I
> may be missing a use that cannot fit easily into the latter paradigm.  but
> if most people have an alternative then it move from showstopper to "nice to
> have."

Right, I'll see if there is a cleaner way to do that with 
register_cleanup. If I don't find will move that to nice_to_have list.

Thanks for the commentary, Geoff.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

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

View raw message