You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2011/03/31 17:12:09 UTC
svn commit: r1087331 - in /httpd/httpd/trunk: include/http_core.h
include/http_main.h modules/generators/mod_status.c server/core.c
server/main.c
Author: jim
Date: Thu Mar 31 15:12:09 2011
New Revision: 1087331
URL: http://svn.apache.org/viewvc?rev=1087331&view=rev
Log:
Add in a configuration generation... this is independent of
MPM gen, just in case we ever switch MPMs at a graceful ;)
Modified:
httpd/httpd/trunk/include/http_core.h
httpd/httpd/trunk/include/http_main.h
httpd/httpd/trunk/modules/generators/mod_status.c
httpd/httpd/trunk/server/core.c
httpd/httpd/trunk/server/main.c
Modified: httpd/httpd/trunk/include/http_core.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_core.h?rev=1087331&r1=1087330&r2=1087331&view=diff
==============================================================================
--- httpd/httpd/trunk/include/http_core.h (original)
+++ httpd/httpd/trunk/include/http_core.h Thu Mar 31 15:12:09 2011
@@ -808,6 +808,8 @@ AP_DECLARE(int) ap_state_query(int query
#define AP_SQ_MAIN_STATE 0
/** are we going to serve requests or are we just testing/dumping config */
#define AP_SQ_RUN_MODE 1
+ /** generation of the top-level apache parent */
+#define AP_SQ_CONFIG_GEN 2
/*
* return values for ap_state_query()
Modified: httpd/httpd/trunk/include/http_main.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_main.h?rev=1087331&r1=1087330&r2=1087331&view=diff
==============================================================================
--- httpd/httpd/trunk/include/http_main.h (original)
+++ httpd/httpd/trunk/include/http_main.h Thu Mar 31 15:12:09 2011
@@ -51,6 +51,8 @@ AP_DECLARE_DATA extern apr_pool_t *ap_pg
AP_DECLARE_DATA extern int ap_main_state;
/** run mode (normal, config test, config dump, ...) */
AP_DECLARE_DATA extern int ap_run_mode;
+/** run mode (normal, config test, config dump, ...) */
+AP_DECLARE_DATA extern int ap_config_generation;
/* for -C, -c and -D switches */
/** An array of all -C directives. These are processed before the server's
Modified: httpd/httpd/trunk/modules/generators/mod_status.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_status.c?rev=1087331&r1=1087330&r2=1087331&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_status.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_status.c Thu Mar 31 15:12:09 2011
@@ -390,7 +390,9 @@ static int status_handler(request_rec *r
ap_scoreboard_image->global->restart_time,
DEFAULT_TIME_FORMAT, 0),
"</dt>\n", NULL);
- ap_rprintf(r, "<dt>Parent Server Generation: %d</dt>\n",
+ ap_rprintf(r, "<dt>Parent Server Config. Generation: %d</dt>\n",
+ ap_state_query(AP_SQ_CONFIG_GEN));
+ ap_rprintf(r, "<dt>Parent Server MPM Generation: %d</dt>\n",
(int)mpm_generation);
ap_rputs("<dt>Server uptime: ", r);
show_time(r, up_time);
Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1087331&r1=1087330&r2=1087331&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Thu Mar 31 15:12:09 2011
@@ -112,6 +112,7 @@ static apr_table_t *server_config_define
AP_DECLARE_DATA int ap_main_state = AP_SQ_MS_INITIAL_STARTUP;
AP_DECLARE_DATA int ap_run_mode = AP_SQ_RM_UNKNOWN;
+AP_DECLARE_DATA int ap_config_generation = 1;
static void *create_core_dir_config(apr_pool_t *a, char *dir)
{
@@ -4368,6 +4369,8 @@ AP_DECLARE(int) ap_state_query(int query
return ap_main_state;
case AP_SQ_RUN_MODE:
return ap_run_mode;
+ case AP_SQ_CONFIG_GEN:
+ return ap_config_generation;
default:
return AP_SQ_NOT_SUPPORTED;
}
Modified: httpd/httpd/trunk/server/main.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/main.c?rev=1087331&r1=1087330&r2=1087331&view=diff
==============================================================================
--- httpd/httpd/trunk/server/main.c (original)
+++ httpd/httpd/trunk/server/main.c Thu Mar 31 15:12:09 2011
@@ -686,6 +686,7 @@ int main(int argc, const char * const ar
apr_pool_destroy(ptemp);
for (;;) {
+ ap_config_generation++;
ap_main_state = AP_SQ_MS_DESTROY_CONFIG;
apr_hook_deregister_all();
apr_pool_clear(pconf);
Re: svn commit: r1087331 - in /httpd/httpd/trunk: include/http_core.h include/http_main.h modules/generators/mod_status.c server/core.c server/main.c
Posted by Jim Jagielski <ji...@jaguNET.com>.
On Mar 31, 2011, at 1:32 PM, Jeff Trawick wrote:
> On Thu, Mar 31, 2011 at 1:20 PM, Jim Jagielski <ji...@apache.org> wrote:
>>
>> On Mar 31, 2011, at 11:39 AM, Jeff Trawick wrote:
>>>
>>> there is one true generation, and it is the one you implement here,
>>> and shouldn't be managed by the MPM
>>>
>>
>> Well, I agree, of course, hence the implementation. But I was
>> hesitant to touch the mpm "perception" of generation, since
>> that's something that's been exposed for awhile...
>
> It has already changed in 2.3.x in that you have to use ap_mpm_query()
> to find the generation.
>
> I think main() just tells the MPM what the generation is and the MPM
> goes about its business with minimal code changes.
> ap_mpm_query(GENERATION) would still work if we choose, but we could
> back that out, preferring one-true-way over making 2.3.current modules
> happy.
>
> I'm happy to try this out in a few days.
>
I haven't looked, but yeah, it might not be as all-encompasing
as I think ;)
Re: svn commit: r1087331 - in /httpd/httpd/trunk: include/http_core.h
include/http_main.h modules/generators/mod_status.c server/core.c server/main.c
Posted by Jeff Trawick <tr...@gmail.com>.
On Thu, Mar 31, 2011 at 1:20 PM, Jim Jagielski <ji...@apache.org> wrote:
>
> On Mar 31, 2011, at 11:39 AM, Jeff Trawick wrote:
>>
>> there is one true generation, and it is the one you implement here,
>> and shouldn't be managed by the MPM
>>
>
> Well, I agree, of course, hence the implementation. But I was
> hesitant to touch the mpm "perception" of generation, since
> that's something that's been exposed for awhile...
It has already changed in 2.3.x in that you have to use ap_mpm_query()
to find the generation.
I think main() just tells the MPM what the generation is and the MPM
goes about its business with minimal code changes.
ap_mpm_query(GENERATION) would still work if we choose, but we could
back that out, preferring one-true-way over making 2.3.current modules
happy.
I'm happy to try this out in a few days.
Re: svn commit: r1087331 - in /httpd/httpd/trunk: include/http_core.h include/http_main.h modules/generators/mod_status.c server/core.c server/main.c
Posted by Jim Jagielski <ji...@apache.org>.
On Mar 31, 2011, at 11:39 AM, Jeff Trawick wrote:
>
> there is one true generation, and it is the one you implement here,
> and shouldn't be managed by the MPM
>
Well, I agree, of course, hence the implementation. But I was
hesitant to touch the mpm "perception" of generation, since
that's something that's been exposed for awhile...
Re: svn commit: r1087331 - in /httpd/httpd/trunk: include/http_core.h
include/http_main.h modules/generators/mod_status.c server/core.c server/main.c
Posted by Jeff Trawick <tr...@gmail.com>.
On Thu, Mar 31, 2011 at 12:52 PM, William A. Rowe Jr.
<wr...@rowe-clan.net> wrote:
> On 3/31/2011 10:39 AM, Jeff Trawick wrote:
>> On Thu, Mar 31, 2011 at 11:12 AM, <ji...@apache.org> wrote:
>>> Author: jim
>>> Date: Thu Mar 31 15:12:09 2011
>>> New Revision: 1087331
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1087331&view=rev
>>> Log:
>>> Add in a configuration generation... this is independent of
>>> MPM gen, just in case we ever switch MPMs at a graceful ;)
>>
>> switching MPMs at graceful is bad news (how do you manage the children
>> of the previous generation?)
>>
>> there is one true generation, and it is the one you implement here,
>> and shouldn't be managed by the MPM
>
> Yup, +1 to disallowing this entirely, causing the server to shut down
> if it is even attempted.
I guess main() calls ap_show_mpm_name() (sp.?) after the first load
and bails out if it ever changes after modules are reloaded. I don't
see any need to distinguish flavor of restart; it could cause problems
over hard restart too.
Re: svn commit: r1087331 - in /httpd/httpd/trunk: include/http_core.h
include/http_main.h modules/generators/mod_status.c server/core.c server/main.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 3/31/2011 10:39 AM, Jeff Trawick wrote:
> On Thu, Mar 31, 2011 at 11:12 AM, <ji...@apache.org> wrote:
>> Author: jim
>> Date: Thu Mar 31 15:12:09 2011
>> New Revision: 1087331
>>
>> URL: http://svn.apache.org/viewvc?rev=1087331&view=rev
>> Log:
>> Add in a configuration generation... this is independent of
>> MPM gen, just in case we ever switch MPMs at a graceful ;)
>
> switching MPMs at graceful is bad news (how do you manage the children
> of the previous generation?)
>
> there is one true generation, and it is the one you implement here,
> and shouldn't be managed by the MPM
Yup, +1 to disallowing this entirely, causing the server to shut down
if it is even attempted.
Re: svn commit: r1087331 - in /httpd/httpd/trunk: include/http_core.h
include/http_main.h modules/generators/mod_status.c server/core.c server/main.c
Posted by Jeff Trawick <tr...@gmail.com>.
On Thu, Mar 31, 2011 at 11:12 AM, <ji...@apache.org> wrote:
> Author: jim
> Date: Thu Mar 31 15:12:09 2011
> New Revision: 1087331
>
> URL: http://svn.apache.org/viewvc?rev=1087331&view=rev
> Log:
> Add in a configuration generation... this is independent of
> MPM gen, just in case we ever switch MPMs at a graceful ;)
switching MPMs at graceful is bad news (how do you manage the children
of the previous generation?)
there is one true generation, and it is the one you implement here,
and shouldn't be managed by the MPM
I have a couple of MPM things in progress:
* child status hook implemented by MPMs (child created, child exited,
child-lost-slot)
* end-generation hook (common implementation which consumes the child
status hook)
Hopefully I can finish up those in the next couple of days and then
see about consolidating on the one true generation representation.