postgresql/src/backend/postmaster
Alvaro Herrera 82233ce7ea Send SIGKILL to children if they don't die quickly in immediate shutdown
On immediate shutdown, or during a restart-after-crash sequence,
postmaster used to send SIGQUIT (and then abandon ship if shutdown); but
this is not a good strategy if backends don't die because of that
signal.  (This might happen, for example, if a backend gets tangled
trying to malloc() due to gettext(), as in an example illustrated by
MauMau.)  This causes problems when later trying to restart the server,
because some processes are still attached to the shared memory segment.

Instead of just abandoning such backends to their fates, we now have
postmaster hang around for a little while longer, send a SIGKILL after
some reasonable waiting period, and then exit.  This makes immediate
shutdown more reliable.

There is disagreement on whether it's best for postmaster to exit after
sending SIGKILL, or to stick around until all children have reported
death.  If this controversy is resolved differently than what this patch
implements, it's an easy change to make.

Bug reported by MauMau in message 20DAEA8949EC4E2289C6E8E58560DEC0@maumau

MauMau and Álvaro Herrera
2013-06-28 17:49:46 -04:00
..
Makefile Refactor xlog.c to create src/backend/postmaster/startup.c 2011-11-02 14:25:01 +00:00
autovacuum.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
bgwriter.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
checkpointer.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
fork_process.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
pgarch.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
pgstat.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
postmaster.c Send SIGKILL to children if they don't die quickly in immediate shutdown 2013-06-28 17:49:46 -04:00
startup.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
syslogger.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
walwriter.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00