Use an shmem_exit callback to remove backend from PMChildFlags on exit
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Use an shmem_exit callback to remove backend from PMChildFlags on exit This seems nicer than having to duplicate the logic between InitProcess() and ProcKill() for which child processes have a PMChildFlags slot. Move the MarkPostmasterChildActive() call earlier in InitProcess(), out of the section protected by the spinlock. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/a102f15f-eac4-4ff2-af02-f9ff209ec66f@iki.fi
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/ipc/pmsignal.c | modified | +13 −4 |
| src/backend/storage/lmgr/proc.c | modified | +13 −25 |
| src/include/storage/pmsignal.h | modified | +1 −2 |
Discussion
- Refactoring postmaster's code to cleanup after child exit 47 messages · 2024-07-06 → 2026-07-07