From 7aeff9f4a4e57dca5727828bf95f12cf63003270 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Thu, 6 Oct 2011 21:43:14 +0200 Subject: [PATCH] Ensure walsenders can be SIGTERMed while in non-walsender code 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 5d1c5180f2..c8fd165dcb 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -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; }