From 7dbfea3c455e83a77213a92b9dfdc1c0577441ea Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 17 Dec 2019 13:14:28 -0500 Subject: Partially deduplicate interrupt handling for background processes. Where possible, share signal handler code and main loop interrupt checking. This saves quite a bit of code and should simplify maintenance, too. This commit intends not to change the way anything works, even though that might allow more code to be unified. It does unify a bunch of individual variables into a ShutdownRequestPending flag that has is now used by a bunch of different process types, though. Patch by me, reviewed by Andres Freund and Daniel Gustafsson. Discussion: http://postgr.es/m/CA+TgmoZwDk=BguVDVa+qdA6SBKef=PKbaKDQALTC_9qoz1mJqg@mail.gmail.com --- src/backend/replication/logical/worker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/replication/logical/worker.c') diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index 3b12ad64006..4bf6f5e4271 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -45,6 +45,7 @@ #include "parser/parse_relation.h" #include "pgstat.h" #include "postmaster/bgworker.h" +#include "postmaster/interrupt.h" #include "postmaster/postmaster.h" #include "postmaster/walwriter.h" #include "replication/decode.h" @@ -1575,7 +1576,7 @@ ApplyWorkerMain(Datum main_arg) logicalrep_worker_attach(worker_slot); /* Setup signal handling */ - pqsignal(SIGHUP, PostgresSigHupHandler); + pqsignal(SIGHUP, SignalHandlerForConfigReload); pqsignal(SIGTERM, die); BackgroundWorkerUnblockSignals(); -- cgit v1.2.3