You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@gmail.com> on 2004/08/17 12:19:48 UTC

pre_mpm hook, module-created child processes which need to access the scoreboard and config

a module which creates child processes which access the scoreboard
must create that child in the pre_mpm hook, since that is the hook
where the scoreboard is created
(it must be hooked after the core's pre_mpm hook so that the
scoreboard has already been created)

but this hook isn't called on graceful restart, so a module doesn't
have the opportunity to fork a new child to pick up a changed
configuration; the scoreboard itself isn't a problem since it doesn't
change, but the module's own configuration changes won't be known and
if the module's child process is using ThreadsPerChild or MaxClients
or other scoreboard-related values which could be changed across
restart, then it is hosed

if a module could determine if the server is gracefully restarting,
then it could use some combination of post-config and pre-mpm hooks
for creating the child process in order to pick up config changes
whether or not the scoreboard changes
(in post-config hook, if this is graceful restart then replace the old
child process with a new one to pick up the new config; otherwise, do
that in the pre-mpm hook since we have to wait until the scoreboard is
replaced)

it seems simpler to pass a flag to pre-mpm hook to tell it whether or
not the scoreboard should be replaced; the hook to replace the
scoreboard will look at the flag to know when to be a no-op

are there other problematic use cases which involve the pre-mpm hook
and need to be addressed?

any other comments?

Re: pre_mpm hook, module-created child processes which need to access the scoreboard and config

Posted by Jeff Trawick <tr...@gmail.com>.
On Tue, 17 Aug 2004 06:19:48 -0400, Jeff Trawick <tr...@gmail.com> wrote:

> if a module could determine if the server is gracefully restarting,

<humor>
the only way to determine this is to hook the error log and look for
the different NOTICE messages issued by MPMs:

prefork: Graceful restart requested, doing restart
worker: " received.  Doing graceful restart"
</humor>

any other ways?