Partially deduplicate interrupt handling for background processes.
authorRobert Haas <rhaas@postgresql.org>
Tue, 17 Dec 2019 18:14:28 +0000 (13:14 -0500)
committerRobert Haas <rhaas@postgresql.org>
Tue, 17 Dec 2019 18:14:28 +0000 (13:14 -0500)
commit7dbfea3c455e83a77213a92b9dfdc1c0577441ea
tree89ed47744448377a89e05a3ac2316a67c8b02fba
parent1e53fe0e70f610c34f4c9e770d108cd94151342c
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
18 files changed:
src/backend/postmaster/Makefile
src/backend/postmaster/autovacuum.c
src/backend/postmaster/bgworker.c
src/backend/postmaster/bgwriter.c
src/backend/postmaster/checkpointer.c
src/backend/postmaster/interrupt.c [new file with mode: 0644]
src/backend/postmaster/pgarch.c
src/backend/postmaster/pgstat.c
src/backend/postmaster/startup.c
src/backend/postmaster/walwriter.c
src/backend/replication/logical/launcher.c
src/backend/replication/logical/worker.c
src/backend/replication/walreceiver.c
src/backend/replication/walsender.c
src/backend/tcop/postgres.c
src/backend/utils/init/globals.c
src/include/miscadmin.h
src/include/postmaster/interrupt.h [new file with mode: 0644]