pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use _exit(2) for SIGQUIT during ProcessStartupPacket, too.
Date: Thu, 10 Sep 2020 16:06:52 +0000
Message-ID: <E1kGP64-0003d1-FK@gemulon.postgresql.org> (raw)

Use _exit(2) for SIGQUIT during ProcessStartupPacket, too.

Bring the signal handling for startup-packet collection into line
with the policy established in commits bedadc732 and 8e19a8264,
namely don't risk running atexit callbacks when handling SIGQUIT.

Ideally, we'd not do so for SIGTERM or timeout interrupts either,
but that change seems a bit too risky for the back branches.
For now, just improve the comments in this area to describe the risk.

Also relocate where BackendInitialize re-disables these interrupts,
to minimize the code span where they're active.  This doesn't buy
a whole lot of safety, but it can't hurt.

In passing, rename startup_die() to remove confusion about whether
it is for the startup process.

Like the previous commits, back-patch to all supported branches.

Discussion: https://postgr.es/m/1850884.1599601164@sss.pgh.pa.us

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4e10c0c8a6690d9b950a0ab1633de6c02d1a1069

Modified Files
--------------
src/backend/postmaster/postmaster.c | 104 +++++++++++++++++++++++++-----------
1 file changed, 73 insertions(+), 31 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1kGP64-0003d1-FK@gemulon.postgresql.org>
Permalink:  ../E1kGP64-0003d1-FK@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kGP64-0003d1-FK@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Use _exit(2) for SIGQUIT during ProcessStartupPacket, too.
  In-Reply-To: <E1kGP64-0003d1-FK@gemulon.postgresql.org>
  References: <E1kGP64-0003d1-FK@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