From 40a2e3f55bcbc9cbec93bcc4c31226e2cf1ba61d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 30 Sep 2002 20:47:22 +0000 Subject: [PATCH] Back-patch fix for bad SIGUSR2 interrupt handling during backend shutdown. --- src/backend/commands/async.c | 4 ++++ src/backend/tcop/postgres.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index 1da91b836f..84f7fc4195 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -607,6 +607,10 @@ Async_NotifyHandler(SIGNAL_ARGS) * ever turned on. */ + /* Don't joggle the elbow of proc_exit */ + if (proc_exit_inprogress) + return; + if (notifyInterruptEnabled) { /* diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 95e431a0a4..d16056110e 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -1103,12 +1103,14 @@ ProcessInterrupts(void) ProcDiePending = false; QueryCancelPending = false; /* ProcDie trumps QueryCancel */ ImmediateInterruptOK = false; /* not idle anymore */ + DisableNotifyInterrupt(); elog(FATAL, "This connection has been terminated by the administrator."); } if (QueryCancelPending) { QueryCancelPending = false; ImmediateInterruptOK = false; /* not idle anymore */ + DisableNotifyInterrupt(); elog(ERROR, "Query was cancelled."); } /* If we get here, do nothing (probably, QueryCancelPending was reset) */ @@ -1704,7 +1706,7 @@ PostgresMain(int argc, char *argv[], const char *username) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.245.2.2 $ $Date: 2002/02/27 23:17:01 $\n"); + puts("$Revision: 1.245.2.3 $ $Date: 2002/09/30 20:47:22 $\n"); } /* @@ -1751,6 +1753,7 @@ PostgresMain(int argc, char *argv[], const char *username) QueryCancelPending = false; InterruptHoldoffCount = 1; CritSectionCount = 0; /* should be unnecessary, but... */ + DisableNotifyInterrupt(); debug_query_string = NULL; /* used by pgmonitor */ /* -- 2.39.5