pgsql: Provide options for postmaster to kill child processes with SIGA

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Provide options for postmaster to kill child processes with SIGA
Date: 2022-11-21 16:59:35
Message-ID: E1oxA8s-000Ejq-BJ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2022-11-21 17:22:06 Re: pgsql: Prevent instability in contrib/pageinspect's regression test.
Previous Message Tom Lane 2022-11-21 15:51:05 pgsql: Prevent instability in contrib/pageinspect's regression test.