pgsql: Make archiver's SIGQUIT handler exit via _exit().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make archiver's SIGQUIT handler exit via _exit().
Date: 2020-09-09 19:33:02
Message-ID: E1kG5q2-0004dM-JK@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make archiver's SIGQUIT handler exit via _exit().

Commit 8e19a8264 changed the SIGQUIT handlers of almost all server
processes not to run atexit callbacks. The archiver process was
skipped, perhaps because it's not connected to shared memory; but
it's just as true here that running atexit callbacks in a signal
handler is unsafe. So let's make it work like the rest.

In HEAD and v13, we can use the common SignalHandlerForCrashExit
handler. Before that, just tweak pgarch_exit to use _exit(2)
explicitly.

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

Kyotaro Horiguchi, back-patching by me

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/35e59398abbb562f1e831af206f1d1cc8c3cb7db

Modified Files
--------------
src/backend/postmaster/pgarch.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-09-09 22:47:16 Re: pgsql: Implement streaming mode in ReorderBuffer.
Previous Message Peter Eisentraut 2020-09-09 18:41:37 pgsql: Expose internal function for converting int64 to numeric