1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03: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:
Noah Misch
2013-09-11 20:10:15 -04:00
parent 83ec831368
commit 312116ed7d

View File

@ -2488,6 +2488,13 @@ quickdie(SIGNAL_ARGS)
{
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();
/*
* Ideally this should be ereport(FATAL), but then we'd not get control
* back...