diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-08-02 18:39:14 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-08-02 18:39:14 -0400 |
commit | 5816f21d8c7311ff5320c20a9d90c9e98649cec4 (patch) | |
tree | 5f4abf6389205337b4e9c73b5dbf2d0f685c23dc /src | |
parent | d02b38799d956ae6e8d600f081212448abe3f30e (diff) | |
download | postgresql-5816f21d8c7311ff5320c20a9d90c9e98649cec4.tar.gz postgresql-5816f21d8c7311ff5320c20a9d90c9e98649cec4.zip |
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 31c453165.
Thomas Munro
Discussion: <CAEepm=1VOnbVx4wsgQFvj94hu9jVt2nVabCr7QiooUSvPJXkgQ@mail.gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index c576986c6b2..975b98790da 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -4787,8 +4787,6 @@ SubPostmasterMain(int argc, char *argv[]) /* do this as early as possible; in particular, before InitProcess() */ IsBackgroundWorker = true; - InitPostmasterChild(); - /* Close the postmaster's sockets */ ClosePostmasterPorts(false); @@ -4801,8 +4799,10 @@ SubPostmasterMain(int argc, char *argv[]) /* Attach process to shared data structures */ CreateSharedMemoryAndSemaphores(false, 0); + /* Fetch MyBgworkerEntry from shared memory */ shmem_slot = atoi(argv[1] + 15); MyBgworkerEntry = BackgroundWorkerEntry(shmem_slot); + StartBackgroundWorker(); } if (strcmp(argv[1], "--forkarch") == 0) |