Kill dead-end children when there's nothing else left
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Kill dead-end children when there's nothing else left Previously, the postmaster would never try to kill dead-end child processes, even if there were no other processes left. A dead-end backend will eventually exit, when authentication_timeout expires, but if a dead-end backend is the only thing that's preventing the server from shutting down, it seems better to kill it immediately. It's particularly important, if there was a bug in the early startup code that prevented a dead-end child from timing out and exiting normally. Includes a test for that case where a dead-end backend previously prevented the server from shutting down. 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/postmaster/postmaster.c | modified | +9 −8 |
| src/test/perl/PostgreSQL/Test/Cluster.pm | modified | +8 −2 |
| src/test/postmaster/meson.build | modified | +1 −0 |
| src/test/postmaster/t/002_start_stop.pl | added | +98 −0 |
Discussion
- Refactoring postmaster's code to cleanup after child exit 47 messages · 2024-07-06 → 2026-07-07