Merge r1822509, r1822511, r1823412, r1823415, r1823416, r1823564, r1823572, r1823575 from trunk:
mod_slotmem_shm: Rework SHM reuse/deletion.
To fix races with graceful restarts (PR 62044).
This commit does:
1/ use a constant file name for all systems (no generation suffix which
makes a new SHM to be created for each restart, losing previous data)
2/ maintain the list of the created SHMs accross restarts (ap_pglobal list)
3/ not unlink the files on restart anymore (otherwise we can't reuse them)
4/ not attach existing SHMs in slotmem_create() anymore (not suitable since
those are necessarily crash remainders)
5/ add type/sizes consistency check for persisted slots on restoration
6/ unlink the files only on stop/exit or before creating them (crash recovery)
We could possibly avoid 6/ (since we don't need to re-open files now) if we
remove the file just after the SHM is created. This would at least work for
systems with "unlink semantic" (i.e. unlink succeeds even if some descriptors
are opened, the "real" thing happening when the last one desciptor closed), but
this wouldn't work for other systems so I kept the code generic for now.
mod_slotmem_shm: follow up tp r1822509.
Please buildbot (and incidentally users of older APR) by using
apr_shm_remove() instead of the new(er) apr_shm_delete().
mod_slotmem_shm: follow up tp r1822509.
Check SHM sizes when reused, reload may have changed the needs.
mod_slotmem_shm: follow up tp r1822509.
Do not bind attached slotmems to the global list, they should be detached with
the given pool (pchild) is cleaned up, but not destroyed/removed (doubly) with
pglobal.
mod_slotmem_shm: follow up tp r1822509.
Complete layout of SHM and persited file (ascii art).
Simplify an "if" condition, no functional change.
mod_proxy_balancer: follow up tp r1822509.
Rework server_rec ID so that it doesn't change on restart (or stop/start)
unless it's Host(s)/IP(s):port(s), ServerName and/or ServerAlias(es) changed.
The goal being to reuse SHMs (and persisted files) names as much as possible,
with minimal bindings to configuration changes (as far as mod_proxy_balancer
is concerned). So if the ServerName and first Host/IP:port are unique we use
that first, otherwise the ServerAlias(es) and other Host(s)/IP(s):port(s) are
also taken into account, and finally if that's still not enough the server
index is also used (pathological case handled for correctness with regard to
the underlying mod_slotmem_shm's reuse code).
mod_slotmem_shm: follow up tp r1822509.
Fishy "unlink semantic" (description) does not apply anymore.
Follow up to r1822509: amend CHANGES entry.
Submitted by: ylavic
Reviewed by: ylavic, jim, minfrin
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1824180 13f79535-47bb-0310-9956-
ffa450edef68