From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use WaitEventSet API for postmaster's event loop.
Date: Thu, 12 Jan 2023 03:44:26 +0000
Message-ID: <E1pFoVu-003E30-9H@gemulon.postgresql.org> (raw)
Use WaitEventSet API for postmaster's event loop.
Switch to a design similar to regular backends, instead of the previous
arrangement where signal handlers did non-trivial state management and
called fork(). The main changes are:
* The postmaster now has its own local latch to wait on. (For now, we
don't want other backends setting its latch directly, but that could
probably be made to work with more research on robustness.)
* The existing signal handlers are cut in two: a handle_pm_XXX() part
that just sets pending_pm_XXX flags and the latch, and a
process_pm_XXX() part that runs later when the latch is seen.
* Signal handlers are now installed with the regular pqsignal()
function rather than the special pqsignal_pm() function; historical
portability concerns about the effect of SA_RESTART on select() are no
longer relevant, and we don't need to block signals anymore.
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CA%2BhUKG%2BZ-HpOj1JsO9eWUP%2Bar7npSVinsC_npxSy%2BjdOMsx%3DGg%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/7389aad63666a2cac18cd6d7496378d7f50ef37b
Modified Files
--------------
src/backend/libpq/pqcomm.c | 3 +-
src/backend/libpq/pqsignal.c | 40 ----
src/backend/postmaster/fork_process.c | 18 +-
src/backend/postmaster/postmaster.c | 418 ++++++++++++++++++++--------------
src/backend/tcop/postgres.c | 1 -
src/backend/utils/init/miscinit.c | 13 +-
src/include/libpq/pqsignal.h | 3 -
src/include/miscadmin.h | 1 +
8 files changed, 269 insertions(+), 228 deletions(-)
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: tmunro@postgresql.org
Subject: Re: pgsql: Use WaitEventSet API for postmaster's event loop.
In-Reply-To: <E1pFoVu-003E30-9H@gemulon.postgresql.org>
References: <E1pFoVu-003E30-9H@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