mirror of
https://github.com/postgres/postgres.git
synced 2025-08-09 17:03:00 +03:00
Back-patch fix for bad SIGUSR2 interrupt handling during backend shutdown.
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.81 2001/10/25 05:49:23 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.81.2.1 2002/09/30 20:47:22 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@@ -607,6 +607,10 @@ Async_NotifyHandler(SIGNAL_ARGS)
|
|||||||
* ever turned on.
|
* ever turned on.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Don't joggle the elbow of proc_exit */
|
||||||
|
if (proc_exit_inprogress)
|
||||||
|
return;
|
||||||
|
|
||||||
if (notifyInterruptEnabled)
|
if (notifyInterruptEnabled)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.245.2.2 2002/02/27 23:17:01 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.245.2.3 2002/09/30 20:47:22 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* this is the "main" module of the postgres backend and
|
* this is the "main" module of the postgres backend and
|
||||||
@@ -1103,12 +1103,14 @@ ProcessInterrupts(void)
|
|||||||
ProcDiePending = false;
|
ProcDiePending = false;
|
||||||
QueryCancelPending = false; /* ProcDie trumps QueryCancel */
|
QueryCancelPending = false; /* ProcDie trumps QueryCancel */
|
||||||
ImmediateInterruptOK = false; /* not idle anymore */
|
ImmediateInterruptOK = false; /* not idle anymore */
|
||||||
|
DisableNotifyInterrupt();
|
||||||
elog(FATAL, "This connection has been terminated by the administrator.");
|
elog(FATAL, "This connection has been terminated by the administrator.");
|
||||||
}
|
}
|
||||||
if (QueryCancelPending)
|
if (QueryCancelPending)
|
||||||
{
|
{
|
||||||
QueryCancelPending = false;
|
QueryCancelPending = false;
|
||||||
ImmediateInterruptOK = false; /* not idle anymore */
|
ImmediateInterruptOK = false; /* not idle anymore */
|
||||||
|
DisableNotifyInterrupt();
|
||||||
elog(ERROR, "Query was cancelled.");
|
elog(ERROR, "Query was cancelled.");
|
||||||
}
|
}
|
||||||
/* If we get here, do nothing (probably, QueryCancelPending was reset) */
|
/* If we get here, do nothing (probably, QueryCancelPending was reset) */
|
||||||
@@ -1704,7 +1706,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
if (!IsUnderPostmaster)
|
if (!IsUnderPostmaster)
|
||||||
{
|
{
|
||||||
puts("\nPOSTGRES backend interactive interface ");
|
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;
|
QueryCancelPending = false;
|
||||||
InterruptHoldoffCount = 1;
|
InterruptHoldoffCount = 1;
|
||||||
CritSectionCount = 0; /* should be unnecessary, but... */
|
CritSectionCount = 0; /* should be unnecessary, but... */
|
||||||
|
DisableNotifyInterrupt();
|
||||||
debug_query_string = NULL; /* used by pgmonitor */
|
debug_query_string = NULL; /* used by pgmonitor */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user