diff options
author | Greg Studer <greg@10gen.com> | 2013-03-28 16:26:16 -0400 |
---|---|---|
committer | Greg Studer <greg@10gen.com> | 2013-05-09 17:28:33 -0400 |
commit | 61b8f72884dc6fee89b91a30021f41e50cb9de0e (patch) | |
tree | 2218f54ec4e050e47ff3552434a2f2ba4a4f1158 /src/mongo/client/connpool.cpp | |
parent | c37f75c550b80eb060cb6f69bc9c3997532e6104 (diff) | |
download | mongo-61b8f72884dc6fee89b91a30021f41e50cb9de0e.tar.gz |
SERVER-9041 proactively detect background conn failures in conn pools
Diffstat (limited to 'src/mongo/client/connpool.cpp')
-rw-r--r-- | src/mongo/client/connpool.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/client/connpool.cpp b/src/mongo/client/connpool.cpp index 740249d87bb..36cd5919e85 100644 --- a/src/mongo/client/connpool.cpp +++ b/src/mongo/client/connpool.cpp @@ -61,7 +61,8 @@ namespace mongo { microSec > _minValidCreationTimeMicroSec) { _minValidCreationTimeMicroSec = microSec; log() << "Detected bad connection created at " << _minValidCreationTimeMicroSec - << " microSec, clearing pool for " << _hostName << endl; + << " microSec, clearing pool for " << _hostName + << " of " << _pool.size() << " connections" << endl; clear(); } } @@ -148,8 +149,8 @@ namespace mongo { } bool PoolForHost::StoredConnection::ok( time_t now ) { - // if connection has been idle for 30 minutes, kill it - return ( now - when ) < 1800; + // Poke the connection to see if we're still ok + return conn->isStillConnected(); } void PoolForHost::createdOne( DBClientBase * base) { |