ProcessIncomingNotify *must* reset notifyInterruptOccurred when called.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Sep 2010 21:16:51 +0000 (17:16 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Sep 2010 21:16:51 +0000 (17:16 -0400)
This was broken in 9.0 by careless addition of an early-exit path.
Bug report and diagnosis by Jeff Davis.

src/backend/commands/async.c

index 9ff00b768cd61179b573ff592e0e1e3009270cdb..a9923341147a32c289a97ad8ced2ba9919234f4f 100644 (file)
@@ -2090,7 +2090,10 @@ ProcessIncomingNotify(void)
 {
        bool            catchup_enabled;
 
-       /* Do nothing if we aren't actively listening */
+       /* We *must* reset the flag */
+       notifyInterruptOccurred = 0;
+
+       /* Do nothing else if we aren't actively listening */
        if (listenChannels == NIL)
                return;
 
@@ -2102,8 +2105,6 @@ ProcessIncomingNotify(void)
 
        set_ps_display("notify interrupt", false);
 
-       notifyInterruptOccurred = 0;
-
        /*
         * We must run asyncQueueReadAllNotifications inside a transaction, else
         * bad things happen if it gets an error.