Skip to content

Commit e280c63

Browse files
committed
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.
1 parent 232f147 commit e280c63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4668,6 +4668,9 @@ SubPostmasterMain(int argc, char *argv[])
46684668
{
46694669
int shmem_slot;
46704670

4671+
/* do this as early as possible; in particular, before InitProcess() */
4672+
IsBackgroundWorker = true;
4673+
46714674
/* Close the postmaster's sockets */
46724675
ClosePostmasterPorts(false);
46734676

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy