Make archiver's SIGQUIT handler exit via _exit().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 9 Sep 2020 19:32:34 +0000 (15:32 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 9 Sep 2020 19:32:45 +0000 (15:32 -0400)
commitbedadc73220f7b09f29a4741dccd143a21a08dda
tree8a6a5dd9530061d5623ef4bc9c1ee257a890dc9f
parent0aa8f764088ea0f36620ae2955fa6c54ec736c46
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
src/backend/postmaster/pgarch.c