Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c6ea616

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 a253a88 commit c6ea616

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/postmaster/postmaster.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4806,8 +4806,6 @@ SubPostmasterMain(int argc, char *argv[])
48064806
/* do this as early as possible; in particular, before InitProcess() */
48074807
IsBackgroundWorker = true;
48084808

4809-
InitPostmasterChild();
4810-
48114809
/* Close the postmaster's sockets */
48124810
ClosePostmasterPorts(false);
48134811

@@ -4820,8 +4818,10 @@ SubPostmasterMain(int argc, char *argv[])
48204818
/* Attach process to shared data structures */
48214819
CreateSharedMemoryAndSemaphores(false, 0);
48224820

4821+
/* Fetch MyBgworkerEntry from shared memory */
48234822
shmem_slot = atoi(argv[1] + 15);
48244823
MyBgworkerEntry = BackgroundWorkerEntry(shmem_slot);
4824+
48254825
StartBackgroundWorker();
48264826
}
48274827
if (strcmp(argv[1], "--forkarch") == 0)

0 commit comments

Comments
 (0)