postgresql/src/backend/postmaster
Tom Lane 44fc6e259b Centralize setup of SIGQUIT handling for postmaster child processes.
We decided that the policy established in commit 7634bd4f6 for
the bgwriter, checkpointer, walwriter, and walreceiver processes,
namely that they should accept SIGQUIT at all times, really ought
to apply uniformly to all postmaster children.  Therefore, get
rid of the duplicative and inconsistent per-process code for
establishing that signal handler and removing SIGQUIT from BlockSig.
Instead, make InitPostmasterChild do it.

The handler set up by InitPostmasterChild is SignalHandlerForCrashExit,
which just summarily does _exit(2).  In interactive backends, we
almost immediately replace that with quickdie, since we would prefer
to try to tell the client that we're dying.  However, this patch is
changing the behavior of autovacuum (both launcher and workers), as
well as walsenders.  Those processes formerly also used quickdie,
but AFAICS that was just mindless copy-and-paste: they don't have
any interactive client that's likely to benefit from being told this.

The stats collector continues to be an outlier, in that it thinks
SIGQUIT means normal exit.  That should probably be changed for
consistency, but there's another patch set where that's being
dealt with, so I didn't do so here.

Discussion: https://postgr.es/m/644875.1599933441@sss.pgh.pa.us
2020-09-16 16:04:36 -04:00
..
autovacuum.c Centralize setup of SIGQUIT handling for postmaster child processes. 2020-09-16 16:04:36 -04:00
bgworker.c Centralize setup of SIGQUIT handling for postmaster child processes. 2020-09-16 16:04:36 -04:00
bgwriter.c Centralize setup of SIGQUIT handling for postmaster child processes. 2020-09-16 16:04:36 -04:00
checkpointer.c Centralize setup of SIGQUIT handling for postmaster child processes. 2020-09-16 16:04:36 -04:00
fork_process.c Use RAND_poll() for seeding randomness after fork(). 2020-07-25 14:50:59 -07:00
interrupt.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
Makefile Partially deduplicate interrupt handling for background processes. 2019-12-17 13:14:28 -05:00
pgarch.c Centralize setup of SIGQUIT handling for postmaster child processes. 2020-09-16 16:04:36 -04:00
pgstat.c Fix inconsistency in determining the timestamp of the db statfile. 2020-09-12 08:02:54 +05:30
postmaster.c Centralize setup of SIGQUIT handling for postmaster child processes. 2020-09-16 16:04:36 -04:00
startup.c Centralize setup of SIGQUIT handling for postmaster child processes. 2020-09-16 16:04:36 -04:00
syslogger.c Remove am_syslogger global variable 2020-03-13 14:01:15 +01:00
walwriter.c Centralize setup of SIGQUIT handling for postmaster child processes. 2020-09-16 16:04:36 -04:00