summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamantharitter <samantha.ritter@10gen.com>2016-09-22 14:05:18 -0400
committersamantharitter <samantha.ritter@10gen.com>2016-09-22 17:21:48 -0400
commitc4e24cbbfd3948273c27726c0170b562eca30bb4 (patch)
tree009a6f45149c3ba9362c2963c2d3819568f1a26f
parent168d00f4aacf2f6f792009e0e5049706af43b9e5 (diff)
downloadmongo-c4e24cbbfd3948273c27726c0170b562eca30bb4.tar.gz
SERVER-16292 Wait to fork until the server is listening
-rw-r--r--src/mongo/db/db.cpp7
-rw-r--r--src/mongo/s/server.cpp8
2 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 72e4c0ed240..71754d037b7 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -699,9 +699,6 @@ ExitCode _initAndListen(int listenPort) {
web.detach();
}
-#ifndef _WIN32
- mongo::signalForkSuccess();
-#endif
AuthorizationManager* globalAuthzManager = getGlobalAuthorizationManager();
if (globalAuthzManager->shouldValidateAuthSchemaOnStartup()) {
Status status = authindex::verifySystemIndexes(startupOpCtx.get());
@@ -820,6 +817,10 @@ ExitCode _initAndListen(int listenPort) {
return EXIT_NET_ERROR;
}
+#ifndef _WIN32
+ mongo::signalForkSuccess();
+#endif
+
return waitForShutdown();
}
diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp
index aafdfcb7502..3a2bce364e5 100644
--- a/src/mongo/s/server.cpp
+++ b/src/mongo/s/server.cpp
@@ -284,10 +284,6 @@ static ExitCode runMongosServer() {
Grid::get(opCtx.get())->getBalancerConfiguration()->refreshAndCheck(opCtx.get());
}
-#if !defined(_WIN32)
- mongo::signalForkSuccess();
-#endif
-
if (serverGlobalParams.isHttpInterfaceEnabled) {
std::shared_ptr<DbWebServer> dbWebServer(new DbWebServer(serverGlobalParams.bind_ip,
serverGlobalParams.port + 1000,
@@ -325,6 +321,10 @@ static ExitCode runMongosServer() {
return EXIT_NET_ERROR;
}
+#if !defined(_WIN32)
+ mongo::signalForkSuccess();
+#endif
+
// Block until shutdown.
return waitForShutdown();
}