pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Partially deduplicate interrupt handling for background processe
Date: Tue, 17 Dec 2019 18:18:22 +0000
Message-ID: <E1ihHQM-0005wd-J6@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7dbfea3c455e83a77213a92b9dfdc1c0577441ea

Modified Files
--------------
src/backend/postmaster/Makefile            |   1 +
src/backend/postmaster/autovacuum.c        |  29 +++-----
src/backend/postmaster/bgworker.c          |  25 +------
src/backend/postmaster/bgwriter.c          |  93 ++-----------------------
src/backend/postmaster/checkpointer.c      |  60 ++--------------
src/backend/postmaster/interrupt.c         | 108 +++++++++++++++++++++++++++++
src/backend/postmaster/pgarch.c            |  29 ++------
src/backend/postmaster/pgstat.c            |  28 ++------
src/backend/postmaster/startup.c           |  34 +--------
src/backend/postmaster/walwriter.c         |  84 ++--------------------
src/backend/replication/logical/launcher.c |   3 +-
src/backend/replication/logical/worker.c   |   3 +-
src/backend/replication/walreceiver.c      |  31 +--------
src/backend/replication/walsender.c        |   4 +-
src/backend/tcop/postgres.c                |  22 +-----
src/backend/utils/init/globals.c           |   1 -
src/include/miscadmin.h                    |   3 -
src/include/postmaster/interrupt.h         |  32 +++++++++
18 files changed, 191 insertions(+), 399 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1ihHQM-0005wd-J6@gemulon.postgresql.org>
Permalink:  ../E1ihHQM-0005wd-J6@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ihHQM-0005wd-J6@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Partially deduplicate interrupt handling for background processe
  In-Reply-To: <E1ihHQM-0005wd-J6@gemulon.postgresql.org>
  References: <E1ihHQM-0005wd-J6@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox