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)