Skip to content

Commit 312116e

Browse files
committed
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.
1 parent 83ec831 commit 312116e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/backend/tcop/postgres.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,6 +2488,13 @@ quickdie(SIGNAL_ARGS)
24882488
{
24892489
PG_SETMASK(&BlockSig);
24902490

2491+
/*
2492+
* Prevent interrupts while exiting; though we just blocked signals that
2493+
* would queue new interrupts, one may have been pending. We don't want a
2494+
* quickdie() downgraded to a mere query cancel.
2495+
*/
2496+
HOLD_INTERRUPTS();
2497+
24912498
/*
24922499
* Ideally this should be ereport(FATAL), but then we'd not get control
24932500
* back...

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy