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:
parent
232f1475dc
commit
e280c630a8
@ -4668,6 +4668,9 @@ SubPostmasterMain(int argc, char *argv[])
|
||||
{
|
||||
int shmem_slot;
|
||||
|
||||
/* do this as early as possible; in particular, before InitProcess() */
|
||||
IsBackgroundWorker = true;
|
||||
|
||||
/* Close the postmaster's sockets */
|
||||
ClosePostmasterPorts(false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user