diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-10-28 11:01:53 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-10-28 11:01:53 -0400 |
commit | bb8640fbfaa195a0b6931a60dc72ccfa88376331 (patch) | |
tree | de5e81f79970d993781ae2648a7a4d1dbf78d276 | |
parent | b5d33b2b1564edb7d6778f7a8392472af61239a4 (diff) | |
download | mongo-bb8640fbfaa195a0b6931a60dc72ccfa88376331.tar.gz |
SERVER-7306 Mongod as windows service should not claim to be 'started' until it is ready to accept connections
-rw-r--r-- | src/mongo/db/db.cpp | 7 | ||||
-rw-r--r-- | src/mongo/s/server.cpp | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index 7699483ad97..fde9d258edd 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -814,6 +814,11 @@ ExitCode _initAndListen(int listenPort) { #ifndef _WIN32 mongo::signalForkSuccess(); +#else + if (ntservice::shouldStartService()) { + ntservice::reportStatus(SERVICE_RUNNING); + log() << "Service running"; + } #endif return waitForShutdown(); @@ -841,8 +846,6 @@ ExitCode initAndListen(int listenPort) { #if defined(_WIN32) ExitCode initService() { - ntservice::reportStatus(SERVICE_RUNNING); - log() << "Service running"; return initAndListen(serverGlobalParams.port); } #endif diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp index 2ab51471946..dd60c2bc0f9 100644 --- a/src/mongo/s/server.cpp +++ b/src/mongo/s/server.cpp @@ -325,6 +325,11 @@ static ExitCode runMongosServer() { #if !defined(_WIN32) mongo::signalForkSuccess(); +#else + if (ntservice::shouldStartService()) { + ntservice::reportStatus(SERVICE_RUNNING); + log() << "Service running"; + } #endif // Block until shutdown. @@ -399,9 +404,6 @@ static int _main() { #if defined(_WIN32) namespace mongo { static ExitCode initService() { - ntservice::reportStatus(SERVICE_RUNNING); - log() << "Service running"; - return runMongosServer(); } } // namespace mongo |