diff options
author | samantharitter <samantha.ritter@10gen.com> | 2017-05-25 17:51:17 -0400 |
---|---|---|
committer | samantharitter <samantha.ritter@10gen.com> | 2017-05-30 11:22:57 -0400 |
commit | fad590916a30ff34dc8c3b37afcfffa2c4e5c8bc (patch) | |
tree | c57610dde742c1e17316b756c9ccb4215ce58db6 /src/mongo/client/connpool.cpp | |
parent | 6a11fc05770306b5d660b21f339cba110d6d67d4 (diff) | |
download | mongo-fad590916a30ff34dc8c3b37afcfffa2c4e5c8bc.tar.gz |
SERVER-29152 Do not cache logging ostream in threadlocal when in other thread-specific contexts
Diffstat (limited to 'src/mongo/client/connpool.cpp')
-rw-r--r-- | src/mongo/client/connpool.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mongo/client/connpool.cpp b/src/mongo/client/connpool.cpp index fce7beb2224..72b6d0b5c84 100644 --- a/src/mongo/client/connpool.cpp +++ b/src/mongo/client/connpool.cpp @@ -63,8 +63,8 @@ PoolForHost::~PoolForHost() { void PoolForHost::clear() { if (!_parentDestroyed) { - log() << "Dropping all pooled connections to " << _hostName << "(with timeout of " - << _socketTimeout << " seconds)"; + logNoCache() << "Dropping all pooled connections to " << _hostName << "(with timeout of " + << _socketTimeout << " seconds)"; } _pool = decltype(_pool){}; @@ -85,17 +85,17 @@ void PoolForHost::done(DBConnectionPool* pool, DBClientBase* c_raw) { bool isBroken = c->getSockCreationMicroSec() < _minValidCreationTimeMicroSec; if (isFailed || isBroken) { _badConns++; - log() << "Ending connection to host " << _hostName << "(with timeout of " << _socketTimeout - << " seconds)" - << " due to bad connection status; " << openConnections() - << " connections to that host remain open"; + logNoCache() << "Ending connection to host " << _hostName << "(with timeout of " + << _socketTimeout << " seconds)" + << " due to bad connection status; " << openConnections() + << " connections to that host remain open"; pool->onDestroy(c.get()); } else if (_maxPoolSize >= 0 && static_cast<int>(_pool.size()) >= _maxPoolSize) { // We have a pool size that we need to enforce - log() << "Ending idle connection to host " << _hostName << "(with timeout of " - << _socketTimeout << " seconds)" - << " because the pool meets constraints; " << openConnections() - << " connections to that host remain open"; + logNoCache() << "Ending idle connection to host " << _hostName << "(with timeout of " + << _socketTimeout << " seconds)" + << " because the pool meets constraints; " << openConnections() + << " connections to that host remain open"; pool->onDestroy(c.get()); } else { // The connection is probably fine, save for later @@ -107,9 +107,9 @@ void PoolForHost::reportBadConnectionAt(uint64_t microSec) { if (microSec != DBClientBase::INVALID_SOCK_CREATION_TIME && microSec > _minValidCreationTimeMicroSec) { _minValidCreationTimeMicroSec = microSec; - log() << "Detected bad connection created at " << _minValidCreationTimeMicroSec - << " microSec, clearing pool for " << _hostName << " of " << openConnections() - << " connections" << endl; + logNoCache() << "Detected bad connection created at " << _minValidCreationTimeMicroSec + << " microSec, clearing pool for " << _hostName << " of " << openConnections() + << " connections" << endl; clear(); } } @@ -550,8 +550,8 @@ ScopedDbConnection::~ScopedDbConnection() { } } else { /* see done() comments above for why we log this line */ - log() << "scoped connection to " << _conn->getServerAddress() - << " not being returned to the pool" << endl; + logNoCache() << "scoped connection to " << _conn->getServerAddress() + << " not being returned to the pool" << endl; kill(); } } |