Merge r1831868, r1831869, r1831870, r1831871, r1831872, r1831935, r1831938, r1832479 from trunk:
Restore mod_slotmem_shm from 2.4.29.
Will restart from there to really fix PR 62308 (and PR 62044 still).
This effectively reverts:
- r1831394,
- r1830800,
- r1826970,
- r1826845,
- r1823572,
- r1823416,
- r1823415,
- r1823412,
- r1822511,
- r1822509.
(in 2.4.x, this is part of r1824180)
mod_slotmem_shm: use a generation number for SHM filename on all platforms.
Successive generations can't share the same SHMs because restarts may modify
them under the terminating children, while SHMs are not extensible when all
slots are in use.
This effectively restores r1822341 which was reverted by r1822505.
mod_slotmem_shm: follow up to r1831869.
Don't try to attach SHMs on startup, they might be from a previous crash and
prevent the server to start (on failure to reuse it).
On mpm_winnt though, the pre/post_config() phases are re-run in child process,
and the parent process already created the SMs, so they must be attached there.
mod_slotmem_shm: follow up to r1831869 (check persistent files).
Since persistent files are also reused on stop/start, we must ensure that
they match the same descriptor when reused on the next startup, so add it
to integrity metadata.
Also, the descriptor being the first field in the SHM, we don't need to
copy on the stack it in several places, and can handle it as a pointer.
Follow up to r1831869: update CHANGES entry.
mod_slotmem_shm: follow up to r1831869: fix persisted file size's checksum.
mod_proxy_balancer: clear slotmem slots' inuse flags from persisted files.
Otherwise, when BalancerPersist is enabled, we might fail (re)starting with a
saved slotmem if a BalancerMember was renamed (e.g. PR 62308's port change).
This is because the renamed member is considered a new one, while the old name
still reserves a slot, so we end up missing one room. The overall number of
members does not change so the sizes check succeeds thus the persisted slotmem
is not invalidated. Yet the slomem is not really compatible.
By clearing inuse flags, we still allow for slots to be reused if their index
did not change (thanks to ap_proxy_find_balancershm() and slotmem_fgrab() at
the given index), but will also invalidate renamed slots which don't match the
index. We now have the correct behaviour by slot and the server (re)starts in
any case.
mod_slotmem_shm: follow up to r1831869: fix dead else if condition.
Submitted by: jim, ylavic
Reviewed by: ylavic, jim, druggeri
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1834887 13f79535-47bb-0310-9956-
ffa450edef68