Avoid calling kill() in a postmaster signal handler.
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 24 Aug 2009 17:23:02 +0000 (17:23 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 24 Aug 2009 17:23:02 +0000 (17:23 +0000)
commit05b6072e0aa105998dde376e5a0ede92f090e812
treea52ced91e40f88a9b1a6970651574689ff1e5c24
parentff638906164589e7b5b48dac01de59e18fba25b3
Avoid calling kill() in a postmaster signal handler.

This causes problems when the system load is high, per report from Zdenek
Kotala in <1250860954.1239.114.camel@localhost>; instead of calling kill
directly, have the signal handler set a flag which is checked in ServerLoop.
This way, the handler can return before being called again by a subsequent
signal sent from the autovacuum launcher.  Also, increase the sleep in the
launcher in this failure path to 1 second.

Backpatch to 8.3, which is when the signalling between autovacuum
launcher/postmaster was introduced.

Also, add a couple of ReleasePostmasterChildSlot calls in error paths; this
part backpatched to 8.4 which is when the child slot stuff was introduced.
src/backend/postmaster/autovacuum.c
src/backend/postmaster/postmaster.c