summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/isself.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2014-11-03 15:17:22 -0500
committerSpencer T Brody <spencer@mongodb.com>2014-11-03 18:10:01 -0500
commitd7e6e0be8f54cfa0b57a6515306c56a38dcdf0d1 (patch)
treea21212dbbbc92cc5f7743d2ec8c9f3f88ac18441 /src/mongo/db/repl/isself.cpp
parenta69c4001dd891bf5d9b2862455d743d5d438cc96 (diff)
downloadmongo-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.cpp7
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;