mirror of
https://github.com/zebrajr/postgres.git
synced 2025-12-07 12:20:31 +01: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:
parent
a2a718b223
commit
05c0059b35
|
|
@ -4566,6 +4566,9 @@ SubPostmasterMain(int argc, char *argv[])
|
|||
{
|
||||
int cookie;
|
||||
|
||||
/* do this as early as possible; in particular, before InitProcess() */
|
||||
IsBackgroundWorker = true;
|
||||
|
||||
/* Close the postmaster's sockets */
|
||||
ClosePostmasterPorts(false);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user