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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822509 13f79535-47bb-0310-9956-ffa450edef68
parent
d62c1de2
Please register or sign in to comment