perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [mp2 patch] $Apache::Server::(re)starting functionality
Date Thu, 02 Dec 2004 20:26:53 GMT
Stas Bekman wrote:
> Reposting to the list on gozer's behalf who forgets to hit Reply-All 
> once in a while :)
> Stas Bekman wrote:
>  > This patch returns the functionality we had in mp1:
>  >
>  > use Apache::ServerUtil ();
>  > my $cnt = Apache->server->start_cnt();
>  > open my $fh, ">>/tmp/out" or die "$!";
>  > print $fh "cnt: $cnt\n";
>  > close $fh;
> Interestingly simpler idea. But isn't this what ap_my_generation is more
> or less representing ?

Not quite. Look for example at server/mpm/prefork/prefork.c - it ++ the 
generation only in multiple server mode. Besides there is no API to get 
this ap_my_generation global. It also doesn't behave the same way (numbers 
wise). Also other modules haven't used it to figure out where they are 
just booted (e.g. post_config in mod_rewrite.c). A year ago I've proposed 
an httpd API to handle that centrally, but alas that didn't get anywhere :(

>  > but I'm not sure at all if we want to keep those $Starting/$Restarting
>  > vars, based on previous discussions on httpd-dev those could be totally
>  > wrong since httpd.conf is reparsed too many times (including graceful
>  > and shutdown).
> Yeah, I think $Starting/$Restarting was _way_ to esoteric.
>  > So i was thinking to just give a variable which will return the
>  > generation. So start_cnt() returns 1 when server starts, and 2 when it
>  > immediately restarts.
> Yes, but I'd call it generation or something like that.

Good idea.

>  > please post comments since I want to integrate it now. I need it at
>  > least for the tests.
> +1 on the concept, maybe stick $Starting/$Restarting in Apache::compat ?

That might be tricky. Since it'll require to make those TIE'd variables. 
Otherwise how would they be updated. Or may be just assigning those at 
Apache::compat compile time will just work. Since one needs to load the 
module before using those vars.

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

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

View raw message