1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-18 17:41:14 +03:00

Fix mishandling of background worker PGPROCs in EXEC_BACKEND builds.

InitProcess() relies on IsBackgroundWorker to decide whether the PGPROC
for a new backend should be taken from ProcGlobal's freeProcs or from
bgworkerFreeProcs.  In EXEC_BACKEND builds, InitProcess() is called
sooner than in non-EXEC_BACKEND builds, and IsBackgroundWorker wasn't
getting initialized soon enough.

Report by Noah Misch.  Diagnosis and fix by me.
This commit is contained in:
Robert Haas 2014-07-30 11:25:58 -04:00
parent a2a718b223
commit 05c0059b35

View File

@ -4566,6 +4566,9 @@ SubPostmasterMain(int argc, char *argv[])
{ {
int cookie; int cookie;
/* do this as early as possible; in particular, before InitProcess() */
IsBackgroundWorker = true;
/* Close the postmaster's sockets */ /* Close the postmaster's sockets */
ClosePostmasterPorts(false); ClosePostmasterPorts(false);