diff options
author | Spencer T Brody <spencer@mongodb.com> | 2014-11-03 15:17:22 -0500 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2014-11-03 18:10:01 -0500 |
commit | d7e6e0be8f54cfa0b57a6515306c56a38dcdf0d1 (patch) | |
tree | a21212dbbbc92cc5f7743d2ec8c9f3f88ac18441 /src/mongo/db/repl/isself.cpp | |
parent | a69c4001dd891bf5d9b2862455d743d5d438cc96 (diff) | |
download | mongo-d7e6e0be8f54cfa0b57a6515306c56a38dcdf0d1.tar.gz |
SERVER-15915 Make isself check block until we're listening for incoming network requests
Diffstat (limited to 'src/mongo/db/repl/isself.cpp')
-rw-r--r-- | src/mongo/db/repl/isself.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/repl/isself.cpp b/src/mongo/db/repl/isself.cpp index 2f4fd1c0f86..130e88df83d 100644 --- a/src/mongo/db/repl/isself.cpp +++ b/src/mongo/db/repl/isself.cpp @@ -184,11 +184,12 @@ namespace { } } - if (!Listener::getTimeTracker()) { - // this ensures we are actually running a server - // this may return true later, so may want to retry + // Ensure that the server is up and ready to accept incoming network requests. + const Listener* listener = Listener::getTimeTracker(); + if (!listener) { return false; } + listener->waitUntilListening(); try { DBClientConnection conn; |