aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/async.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-09-16 01:24:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-09-16 01:24:41 +0000
commit53e95eee84e0f8c680ad813091e7226abb24214e (patch)
tree4d0d595ab7d12d8440bf17537d1deecfeffabbb4 /src/backend/commands/async.c
parent5ea9322872c65c5353a305ca5f1c4acfcb486569 (diff)
downloadpostgresql-53e95eee84e0f8c680ad813091e7226abb24214e.tar.gz
postgresql-53e95eee84e0f8c680ad813091e7226abb24214e.zip
Fix for rare race-condition-like failure: if a backend receives SIGUSR2
(notify/SI-overrun interrupt) while it is in process of doing proc_exit, it is possible for Async_NotifyHandler() to try to start a transaction when one is already running. This leads to Asserts() or worse. I think it may only be possible to occur when frontend synchronization is lost (ie, the elog(FATAL) in SocketBackend() fires), but that is a standard occurrence after error during COPY. In any case, I have seen this failure occur during regression tests, so it is definitely possible.
Diffstat (limited to 'src/backend/commands/async.c')
-rw-r--r--src/backend/commands/async.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index 1945c751e18..a3c27b8f810 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.90 2002/09/02 02:47:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.91 2002/09/16 01:24:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -593,6 +593,10 @@ Async_NotifyHandler(SIGNAL_ARGS)
* ever turned on.
*/
+ /* Don't joggle the elbow of proc_exit */
+ if (proc_exit_inprogress)
+ return;
+
if (notifyInterruptEnabled)
{
/*