Skip to content

Commit 3e2aef5

Browse files
committed
Handle Warn_restart_ready properly in SIGTERM safety patch.
1 parent 3a14336 commit 3e2aef5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/utils/error/elog.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.133 2004/04/11 00:54:45 momjian Exp $
40+
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.134 2004/04/16 12:59:05 momjian Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -448,6 +448,10 @@ errfinish(int dummy,...)
448448
if (in_fatal_exit)
449449
ereport(PANIC, (errmsg("fatal error during fatal exit, giving up")));
450450

451+
/* not safe to longjump */
452+
if (!Warn_restart_ready || proc_exit_inprogress)
453+
proc_exit(proc_exit_inprogress || !IsUnderPostmaster);
454+
451455
/* We will exit the backend by simulating a client EOF */
452456
in_fatal_exit = true;
453457
}

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