Commit 74196a22 authored by Yann Ylavic's avatar Yann Ylavic
Browse files

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 sys...
parent d62c1de2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment