mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Ignore interrupts during quickdie().
Once the administrator has called for an immediate shutdown or a backend crash has triggered a reinitialization, no mere SIGINT or SIGTERM should change that course. Such derailment remains possible when the signal arrives before quickdie() blocks signals. That being a narrow race affecting most PostgreSQL signal handlers in some way, leave it for another patch. Back-patch this to all supported versions.
This commit is contained in:
parent
a49d0b75ce
commit
d41cb869aa
@ -2524,6 +2524,13 @@ quickdie(SIGNAL_ARGS)
|
||||
sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
|
||||
PG_SETMASK(&BlockSig);
|
||||
|
||||
/*
|
||||
* Prevent interrupts while exiting; though we just blocked signals that
|
||||
* would queue new interrupts, one may have been pending. We don't want a
|
||||
* quickdie() downgraded to a mere query cancel.
|
||||
*/
|
||||
HOLD_INTERRUPTS();
|
||||
|
||||
/*
|
||||
* If we're aborting out of client auth, don't risk trying to send
|
||||
* anything to the client; we will likely violate the protocol, not to
|
||||
|
Loading…
Reference in New Issue
Block a user