summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2015-09-16 15:53:34 -0400
committerJason Carey <jcarey@argv.me>2015-09-16 15:53:34 -0400
commite7fe0e33f2f8472c858251192770deafe6d05fef (patch)
tree6f6d03eac8426b6a26cd11796be4971691bc0cdb /src
parentb4c5275fa3de87d63ef408fdcdca66db420c3306 (diff)
downloadmongo-e7fe0e33f2f8472c858251192770deafe6d05fef.tar.gz
Revert "SERVER-20436 more updateState for NI ASIO ConnPool"
This reverts commit 6bd10b12ce52ae01d5f5782e4fa6dacc31742c43.
Diffstat (limited to 'src')
-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 2aaac2a41f3..1249cdffa7a 100644
--- a/src/mongo/executor/connection_pool.cpp
+++ b/src/mongo/executor/connection_pool.cpp
@@ -384,13 +384,13 @@ void ConnectionPool::SpecificPool::fulfillRequests(stdx::unique_lock<stdx::mutex
auto cb = std::move(_requests.top().second);
_requests.pop();
+ updateStateInLock();
+
auto connPtr = conn.get();
// check out the connection
_checkedOutPool[connPtr] = std::move(conn);
- updateStateInLock();
-
// pass it to the user
lk.unlock();
cb(ConnectionHandle(connPtr, ConnectionHandleDeleter(_parent)));
@@ -447,6 +447,9 @@ void ConnectionPool::SpecificPool::spawnConnections(stdx::unique_lock<stdx::mute
void ConnectionPool::SpecificPool::shutdown() {
stdx::unique_lock<stdx::mutex> lk(_parent->_mutex);
+ if (_state == State::kRunning)
+ return;
+
_state = State::kInShutdown;
// If we have processing connections, wait for them to finish or timeout
@@ -516,8 +519,6 @@ void ConnectionPool::SpecificPool::updateStateInLock() {
auto cb = std::move(x.second);
_requests.pop();
- updateStateInLock();
-
lk.unlock();
cb(Status(ErrorCodes::ExceededTimeLimit,
"Couldn't get a connection within the time limit"));