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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use _exit(2) for SIGQUIT during ProcessStartupPacket, too.
Date: 2020-09-10 16:06:52
Message-ID: E1kGP64-0003cx-EZ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/58c6feccfae1321ea4ff16c535c6f3fb90a07d69

Modified Files
--------------
src/backend/postmaster/postmaster.c | 83 +++++++++++++++++++++++--------------
1 file changed, 51 insertions(+), 32 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-09-10 17:14:13 pgsql: Doc: fill in "major enhancements" list in v13 release notes.
Previous Message Robert Haas 2020-09-10 15:20:57 pgsql: New contrib module, pg_surgery, with heap surgery functions.