]> granicus.if.org Git - apache/commit
mod_slomem_shm: Handle a generation number when the slotmem size changes.
authorYann Ylavic <ylavic@apache.org>
Thu, 3 May 2018 08:32:42 +0000 (08:32 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 3 May 2018 08:32:42 +0000 (08:32 +0000)
commitc93e111a6a3091e4418756b3178eecb8c64786c6
treeae350dd481a7a4b03cddab97bb403cd4fdb1924d
parent72eb879561ecb960612b4074e3a356c2872fa258
mod_slomem_shm: Handle a generation number when the slotmem size changes.

Modifying the number of proxy balancers or balancer members on restart
could have prevented the server to load, notably on Windows.  PR 62308.

The generation number integrated in the SHM filename allows to create a
new/resized SHM while the previous is still in use by previous generation
gracefully shutting down (Windows prevents SHM/file to be removed in this
case, but even on Unix(es) an unlinked file might not be re-openable while
an inode exists). The generation number is added/incremented only if the
size requirement changed, such that unrelated restarts continue to share
SHMs between generations.

The cleanup handling is also simplified because both the parent process and
the Windows child process need to cleanup everything on exit. This translates
to cleanup_slotmem() being always registered but in the dry load state
(AP_SQ_MS_CREATE_PRE_CONFIG), for both cases still.

[Reverted by r1831868]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1830800 13f79535-47bb-0310-9956-ffa450edef68
CHANGES
modules/slotmem/mod_slotmem_shm.c