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:43:14 +0000 (21:43 +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 5d1c5180f2d7ea1a9b6f79686fd2135c316c9432..c8fd165dcb3c58607bfd5e6cca56fa0ae765737f 100644 (file)
@@ -1302,6 +1302,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;
 }