Skip to content

Commit 5816f21

Browse files
committed
Remove duplicate InitPostmasterChild() call while starting a bgworker.
This is apparently harmless on Windows, but on Unix it results in an assertion failure. We'd not noticed because this code doesn't get used on Unix unless you build with -DEXEC_BACKEND. Bug was evidently introduced by sloppy refactoring in commit 31c4531. Thomas Munro Discussion: <CAEepm=1VOnbVx4wsgQFvj94hu9jVt2nVabCr7QiooUSvPJXkgQ@mail.gmail.com>
1 parent d02b387 commit 5816f21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4787,8 +4787,6 @@ SubPostmasterMain(int argc, char *argv[])
47874787
/* do this as early as possible; in particular, before InitProcess() */
47884788
IsBackgroundWorker = true;
47894789

4790-
InitPostmasterChild();
4791-
47924790
/* Close the postmaster's sockets */
47934791
ClosePostmasterPorts(false);
47944792

@@ -4801,8 +4799,10 @@ SubPostmasterMain(int argc, char *argv[])
48014799
/* Attach process to shared data structures */
48024800
CreateSharedMemoryAndSemaphores(false, 0);
48034801

4802+
/* Fetch MyBgworkerEntry from shared memory */
48044803
shmem_slot = atoi(argv[1] + 15);
48054804
MyBgworkerEntry = BackgroundWorkerEntry(shmem_slot);
4805+
48064806
StartBackgroundWorker();
48074807
}
48084808
if (strcmp(argv[1], "--forkarch") == 0)

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