postgresql/src
Tom Lane 27b2c6a1ef Don't launch new child processes after we've been told to shut down.
Once we've received a shutdown signal (SIGINT or SIGTERM), we should not
launch any more child processes, even if we get signals requesting such.
The normal code path for spawning backends has always understood that,
but the postmaster's infrastructure for hot standby and autovacuum didn't
get the memo.  As reported by Hari Babu in bug #7643, this could lead to
failure to shut down at all in some cases, such as when SIGINT is received
just before the startup process sends PMSIGNAL_RECOVERY_STARTED: we'd
launch a bgwriter and checkpointer, and then those processes would have no
idea that they ought to quit.  Similarly, launching a new autovacuum worker
would result in waiting till it finished before shutting down.

Also, switch the order of the code blocks in reaper() that detect startup
process crash versus shutdown termination.  Once we've sent it a signal,
we should not consider that exit(1) is surprising.  This is just a cosmetic
fix since shutdown occurs correctly anyway, but better not to log a phony
complaint about startup process crash.

Back-patch to 9.0.  Some parts of this might be applicable before that,
but given the lack of prior complaints I'm not going to worry too much
about older branches.
2012-11-21 15:19:30 -05:00
..
backend Don't launch new child processes after we've been told to shut down. 2012-11-21 15:19:30 -05:00
bin Teach pg_basebackup and pg_receivexlog to reply to server keepalives. 2012-11-08 10:28:52 +02:00
include Fix archive_cleanup_command. 2012-11-19 10:14:20 +02:00
interfaces In our source code, make a copy of getopt's 'optarg' string arguments, 2012-10-12 13:35:43 -04:00
makefiles Fix PGXS support for building loadable modules on AIX. 2012-10-09 21:04:06 -04:00
pl Refactor flex and bison make rules 2012-10-11 06:57:04 -04:00
port Remove redundant code for getnameinfo() replacement 2012-10-04 21:45:14 -04:00
template Remove _FORTIFY_SOURCE 2012-10-10 21:42:38 -04:00
test Improve handling of INT_MIN / -1 and related cases. 2012-11-19 12:24:25 -05:00
timezone In our source code, make a copy of getopt's 'optarg' string arguments, 2012-10-12 13:35:43 -04:00
tools Adjust find_status for newer Linux 'nm' output format. 2012-11-13 21:08:07 -05:00
tutorial
.gitignore
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile
Makefile.global.in Have make never delete intermediate files automatically 2012-10-31 23:33:35 -04:00
Makefile.shlib Remove configure flag --disable-shared, as it is no longer used by any 2012-08-30 16:26:53 -04:00
nls-global.mk
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00