]> granicus.if.org Git - postgresql/commitdiff
Ensure walsenders can be SIGTERMed while in non-walsender code
authorMagnus Hagander <magnus@hagander.net>
Thu, 6 Oct 2011 19:43:14 +0000 (21:43 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 6 Oct 2011 19:45:20 +0000 (21:45 +0200)
In oder to exit on SIGTERM when in non-walsender code,
such as do_pg_stop_backup(), we need to set the interrupt
variables that are used there, and not just the walsender
local ones.

src/backend/replication/walsender.c

index bc7b3146b7bd6c7a363634b8a425a63feda1ad7d..606b9e8571c8073487014dcf6f97f8f4ace70a1a 100644 (file)
@@ -1207,6 +1207,13 @@ WalSndShutdownHandler(SIGNAL_ARGS)
        if (MyWalSnd)
                SetLatch(&MyWalSnd->latch);
 
+       /*
+        * Set the standard (non-walsender) state as well, so that we can
+        * abort things like do_pg_stop_backup().
+        */
+       InterruptPending = true;
+       ProcDiePending = true;
+
        errno = save_errno;
 }