Commit c6ea616f authored by Tom Lane's avatar Tom Lane

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 31c45316.

Thomas Munro

Discussion: <CAEepm=1VOnbVx4wsgQFvj94hu9jVt2nVabCr7QiooUSvPJXkgQ@mail.gmail.com>
parent a253a885
...@@ -4806,8 +4806,6 @@ SubPostmasterMain(int argc, char *argv[]) ...@@ -4806,8 +4806,6 @@ SubPostmasterMain(int argc, char *argv[])
/* do this as early as possible; in particular, before InitProcess() */ /* do this as early as possible; in particular, before InitProcess() */
IsBackgroundWorker = true; IsBackgroundWorker = true;
InitPostmasterChild();
/* Close the postmaster's sockets */ /* Close the postmaster's sockets */
ClosePostmasterPorts(false); ClosePostmasterPorts(false);
...@@ -4820,8 +4818,10 @@ SubPostmasterMain(int argc, char *argv[]) ...@@ -4820,8 +4818,10 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */ /* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0); CreateSharedMemoryAndSemaphores(false, 0);
/* Fetch MyBgworkerEntry from shared memory */
shmem_slot = atoi(argv[1] + 15); shmem_slot = atoi(argv[1] + 15);
MyBgworkerEntry = BackgroundWorkerEntry(shmem_slot); MyBgworkerEntry = BackgroundWorkerEntry(shmem_slot);
StartBackgroundWorker(); StartBackgroundWorker();
} }
if (strcmp(argv[1], "--forkarch") == 0) if (strcmp(argv[1], "--forkarch") == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment