From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Provide options for postmaster to kill child processes with SIGA
Date: Mon, 21 Nov 2022 16:59:35 +0000
Message-ID: <E1oxA8s-000Ejq-BJ@gemulon.postgresql.org> (raw)
Provide options for postmaster to kill child processes with SIGABRT.
The postmaster normally sends SIGQUIT to force-terminate its
child processes after a child crash or immediate-stop request.
If that doesn't result in child exit within a few seconds,
we follow it up with SIGKILL. This patch provides GUC flags
that allow either of these signals to be replaced with SIGABRT.
On typically-configured Unix systems, that will result in a
core dump being produced for each such child. This can be
useful for debugging problems, although it's not something you'd
want to have on in production due to the risk of disk space
bloat from lots of core files.
The old postmaster -T switch, which sent SIGSTOP in place of
SIGQUIT, is changed to be the same as send_abort_for_crash.
As far as I can tell from the code comments, the intent of
that switch was just to block things for long enough to force
core dumps manually, which seems like an unnecessary extra step.
(Maybe at the time, there was no way to get most kernels to
produce core files with per-PID names, requiring manual core
file renaming after each one. But now it's surely the hard way.)
I also took the opportunity to remove the old postmaster -n
(skip shmem reinit) switch, which hasn't actually done anything
in decades, though the documentation still claimed it did.
Discussion: https://postgr.es/m/2251016.1668797294@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/51b5834cd53f0bd068729043b55f7da3ca6bb15f
Modified Files
--------------
doc/src/sgml/config.sgml | 56 +++++++++++++
doc/src/sgml/ref/postgres-ref.sgml | 29 +------
src/backend/main/main.c | 3 +-
src/backend/postmaster/postmaster.c | 153 ++++++++++++------------------------
src/backend/utils/misc/guc_tables.c | 20 +++++
src/include/postmaster/postmaster.h | 2 +
6 files changed, 134 insertions(+), 129 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Provide options for postmaster to kill child processes with SIGA
In-Reply-To: <E1oxA8s-000Ejq-BJ@gemulon.postgresql.org>
References: <E1oxA8s-000Ejq-BJ@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox