summaryrefslogtreecommitdiff
path: root/src/mongo/executor/connection_pool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/executor/connection_pool.cpp')
-rw-r--r--src/mongo/executor/connection_pool.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/executor/connection_pool.cpp b/src/mongo/executor/connection_pool.cpp
index c0c4293e505..41e4e602c65 100644
--- a/src/mongo/executor/connection_pool.cpp
+++ b/src/mongo/executor/connection_pool.cpp
@@ -646,8 +646,9 @@ void ConnectionPool::SpecificPool::returnConnection(ConnectionInterface* connPtr
// If the host and port were dropped, let this lapse
if (conn->getGeneration() == _generation) {
addToReady(lk, std::move(conn));
+ fulfillRequests(lk);
}
- spawnConnections(lk);
+
return;
}
@@ -671,6 +672,8 @@ void ConnectionPool::SpecificPool::returnConnection(ConnectionInterface* connPtr
} else {
// If it's fine as it is, just put it in the ready queue
addToReady(lk, std::move(conn));
+ // TODO This should be scheduled on an executor once we have executor-aware pooling
+ fulfillRequests(lk);
}
updateStateInLock();
@@ -706,8 +709,6 @@ void ConnectionPool::SpecificPool::addToReady(stdx::unique_lock<stdx::mutex>& lk
returnConnection(connPtr, std::move(lk));
}));
-
- fulfillRequests(lk);
}
// Sets state to shutdown and kicks off the failure protocol to tank existing connections
@@ -860,8 +861,8 @@ void ConnectionPool::SpecificPool::spawnConnections(stdx::unique_lock<stdx::mute
// If the host and port was dropped, let the connection lapse
if (conn->getGeneration() == _generation) {
addToReady(lk, std::move(conn));
+ fulfillRequests(lk);
}
- spawnConnections(lk);
} else if (status.code() == ErrorCodes::NetworkInterfaceExceededTimeLimit) {
// If we've exceeded the time limit, restart the connect, rather than
// failing all operations. We do this because the various callers