diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-11-21 11:59:29 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-11-21 11:59:29 -0500 |
commit | 51b5834cd53f0bd068729043b55f7da3ca6bb15f (patch) | |
tree | d1a1d9ab3d33e549360ef39d78f84662723940f9 /src/backend/main/main.c | |
parent | e2933a6e11791191050cd925d52d34e785eece77 (diff) |
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
Diffstat (limited to 'src/backend/main/main.c')
-rw-r--r-- | src/backend/main/main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c index f5da4260a13..67f556b4dd8 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -352,11 +352,10 @@ help(const char *progname) printf(_("\nDeveloper options:\n")); printf(_(" -f s|i|o|b|t|n|m|h forbid use of some plan types\n")); - printf(_(" -n do not reinitialize shared memory after abnormal exit\n")); printf(_(" -O allow system table structure changes\n")); printf(_(" -P disable system indexes\n")); printf(_(" -t pa|pl|ex show timings after each query\n")); - printf(_(" -T send SIGSTOP to all backend processes if one dies\n")); + printf(_(" -T send SIGABRT to all backend processes if one dies\n")); printf(_(" -W NUM wait NUM seconds to allow attach from a debugger\n")); printf(_("\nOptions for single-user mode:\n")); |