diff options
author | Robert Haas <rhaas@postgresql.org> | 2019-12-17 13:14:28 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2019-12-17 13:14:28 -0500 |
commit | 7dbfea3c455e83a77213a92b9dfdc1c0577441ea (patch) | |
tree | 89ed47744448377a89e05a3ac2316a67c8b02fba /src/backend/replication/logical/launcher.c | |
parent | 1e53fe0e70f610c34f4c9e770d108cd94151342c (diff) |
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
Diffstat (limited to 'src/backend/replication/logical/launcher.c')
-rw-r--r-- | src/backend/replication/logical/launcher.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/replication/logical/launcher.c b/src/backend/replication/logical/launcher.c index edca70c58c3..99cfa5d8b49 100644 --- a/src/backend/replication/logical/launcher.c +++ b/src/backend/replication/logical/launcher.c @@ -30,6 +30,7 @@ #include "pgstat.h" #include "postmaster/bgworker.h" #include "postmaster/fork_process.h" +#include "postmaster/interrupt.h" #include "postmaster/postmaster.h" #include "replication/logicallauncher.h" #include "replication/logicalworker.h" @@ -955,7 +956,7 @@ ApplyLauncherMain(Datum main_arg) LogicalRepCtx->launcher_pid = MyProcPid; /* Establish signal handlers. */ - pqsignal(SIGTERM, PostgresSigHupHandler); + pqsignal(SIGTERM, SignalHandlerForConfigReload); pqsignal(SIGTERM, die); BackgroundWorkerUnblockSignals(); |