Content-Length: 266328 | pFad | http://github.com/postgrespro/postgres/commit/d41cb869aad493178777b6e6e8d1425535349acb

20 Ignore interrupts during quickdie(). · postgrespro/postgres@d41cb86 · GitHub
Skip to content

Commit d41cb86

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 a49d0b7 commit d41cb86

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
@@ -2524,6 +2524,13 @@ quickdie(SIGNAL_ARGS)
25242524
sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
25252525
PG_SETMASK(&BlockSig);
25262526

2527+
/*
2528+
* Prevent interrupts while exiting; though we just blocked signals that
2529+
* would queue new interrupts, one may have been pending. We don't want a
2530+
* quickdie() downgraded to a mere query cancel.
2531+
*/
2532+
HOLD_INTERRUPTS();
2533+
25272534
/*
25282535
* If we're aborting out of client auth, don't risk trying to send
25292536
* anything to the client; we will likely violate the protocol, not to

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/d41cb869aad493178777b6e6e8d1425535349acb

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy