postgresql/src/backend/postmaster
Tom Lane e2c9bedc96 Use _exit(2) for SIGQUIT during ProcessStartupPacket, too.
Bring the signal handling for startup-packet collection into line
with the policy established in commits bedadc732 and 8e19a8264,
namely don't risk running atexit callbacks when handling SIGQUIT.

Ideally, we'd not do so for SIGTERM or timeout interrupts either,
but that change seems a bit too risky for the back branches.
For now, just improve the comments in this area to describe the risk.

Also relocate where BackendInitialize re-disables these interrupts,
to minimize the code span where they're active.  This doesn't buy
a whole lot of safety, but it can't hurt.

In passing, rename startup_die() to remove confusion about whether
it is for the startup process.

Like the previous commits, back-patch to all supported branches.

Discussion: https://postgr.es/m/1850884.1599601164@sss.pgh.pa.us
2020-09-10 12:06:26 -04:00
..
autovacuum.c Clean up properly error_context_stack in autovacuum worker on exception 2019-10-23 10:26:23 +09:00
bgworker.c Avoid lockup of a parallel worker when reporting a long error message. 2020-09-03 16:52:09 -04:00
bgwriter.c Don't run atexit callbacks in quickdie signal handlers. 2018-08-08 19:09:35 +03:00
checkpointer.c Make checkpoint requests more robust. 2019-03-19 12:49:27 -04:00
fork_process.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Allow background workers to be started dynamically. 2013-07-16 13:02:15 -04:00
pgarch.c Make archiver's SIGQUIT handler exit via _exit(). 2020-09-09 15:32:34 -04:00
pgstat.c Rearrange pgstat_bestart() to avoid failures within its critical section. 2019-05-11 21:27:13 -04:00
postmaster.c Use _exit(2) for SIGQUIT during ProcessStartupPacket, too. 2020-09-10 12:06:26 -04:00
startup.c Don't run atexit callbacks in quickdie signal handlers. 2018-08-08 19:09:35 +03:00
syslogger.c Make syslogger more robust against failures in opening CSV log files. 2018-08-26 14:21:55 -04:00
walwriter.c Don't run atexit callbacks in quickdie signal handlers. 2018-08-08 19:09:35 +03:00