Greg Ames wrote:
>
> "Paul J. Reder" wrote:
> >
> > @@ -568,7 +579,7 @@
> > apr_signal(SIGHUP, just_die);
> > apr_signal(SIGTERM, just_die);
> >
> > - while (!ap_graceful_stop_signalled()) {
> > + while ((!ap_graceful_stop_signalled()) && (!ap_idle_die_signalled())) {
> >
>
> This is part of the mainline request loop. Couldn't this be optimized
> so that we don't need to check two conditions, each of which is a
> function call checking two conditions, one of which is deferred_die in
> both functions?
These two functions could easily be merged, and with a very small amount of
effort turned into macros. My main reason for not doing that was to make the
idle cleanup code clear and separate.
>
> I could see moving some of the path length into the graceful
> restart/shutdown code, since it doesn't run very often. It could walk
> thru the scoreboard and put some appropriate DIE value into the
> life_status field for each worker. The signal handler that now sets
> deferred_die could set some appropriate DIE value into its own
> scoreboard slot instead. Then the checks in the request loop could be
> simplified to something like (scoreboard[my_slot].life_status !=
> SB_WORKING). Does that make sense?
Are you suggesting merging the restart (generation) and idle cleanup flags?
I was deliberately keeping those concepts separate due to the difference in
scope (all kids versus just the few extras). If folks agree that merging the
flag from the workers perspective isn't a problem then the code to initiate a
graceful restart would just tag all the kids, and the idle cleanup code would
just tag the one to be cleaned up.
Anyone else want to voice an opinion.
>
> > - if (ap_graceful_stop_signalled()) {
> > + if ((ap_graceful_stop_signalled()) || (ap_idle_die_signalled())) {
> > clean_child_exit(0);
> > }
> > usr1_just_die = 1;
>
> same comment as above.
Same answer as above.
>
> Greg
--
Paul J. Reder
-----------------------------------------------------------
"The strength of the Constitution lies entirely in the determination of each
citizen to defend it. Only if every single citizen feels duty bound to do
his share in this defense are the constitutional rights secure."
-- Albert Einstein