postgresql/src
Tom Lane dba1f310a5 Fix postmaster's handling of fork failure for a bgworker process.
This corner case didn't behave nicely at all: the postmaster would
(partially) update its state as though the process had started
successfully, and be quite confused thereafter.  Fix it to act
like the worker had crashed, instead.

In passing, refactor so that do_start_bgworker contains all the
state-change logic for bgworker launch, rather than just some of it.

Back-patch as far as 9.4.  9.3 contains similar logic, but it's just
enough different that I don't feel comfortable applying the patch
without more study; and the use of bgworkers in 9.3 was so small
that it doesn't seem worth the extra work.

transam/parallel.c is still entirely unprepared for the possibility
of bgworker startup failure, but that seems like material for a
separate patch.

Discussion: https://postgr.es/m/4905.1492813727@sss.pgh.pa.us
2017-04-24 12:16:58 -04:00
..
backend Fix postmaster's handling of fork failure for a bgworker process. 2017-04-24 12:16:58 -04:00
bin Avoid depending on non-POSIX behavior of fcntl(2). 2017-04-21 15:55:56 -04:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
include Improve castNode notation by introducing list-extraction-specific variants. 2017-04-10 13:51:29 -04:00
interfaces Spelling fixes 2017-03-14 13:45:51 -04:00
makefiles Link $(WIN32RES) into single-file modules only when PGFILEDESC is set. 2015-08-05 20:45:21 -04:00
pl Adjust PL/Tcl regression test to dodge a possible bug or zone dependency. 2017-02-19 16:14:52 -05:00
port Avoid depending on non-POSIX behavior of fcntl(2). 2017-04-21 15:55:56 -04:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:29 -04:00
test Repair crash with unsortable data in grouping sets. 2017-04-24 07:53:05 +01:00
timezone Update time zone data files to tzdata release 2016j. 2017-01-30 11:40:46 -05:00
tools MSVC: Include pg_recvlogical in client-only install. 2016-09-19 14:27:08 -04:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Document usage of COPT environment variable for adjusting configure flags. 2017-02-17 16:11:02 -05:00
Makefile.shlib Fix typos in comments. 2017-02-06 11:34:18 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00