summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Studer <greg@10gen.com>2012-01-23 13:14:00 -0500
committerEliot Horowitz <eliot@10gen.com>2012-02-01 13:58:17 -0500
commit9a09c9f1af58f8c3f78848cf4e158c082d1bf6be (patch)
tree8b2a4f1fbb8438599cceec4b2422eb9c1fcc93e9
parent527d4d28df94e6cc769d65a94e2827b5b39d6170 (diff)
downloadmongo-9a09c9f1af58f8c3f78848cf4e158c082d1bf6be.tar.gz
SERVER-4712 check that query results are valid before using in case of conn error
-rw-r--r--client/distlock.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/client/distlock.cpp b/client/distlock.cpp
index 595fc38197c..73ee1304f0e 100644
--- a/client/distlock.cpp
+++ b/client/distlock.cpp
@@ -111,6 +111,9 @@ namespace mongo {
// replace it for a quite a while)
// if the lock is taken, the take-over mechanism should handle the situation
auto_ptr<DBClientCursor> c = conn->query( DistributedLock::locksNS , BSONObj() );
+ // TODO: Would be good to make clear whether query throws or returns empty on errors
+ uassert( 16060, str::stream() << "cannot query locks collection on config server " << conn.getHost(), c.get() );
+
set<string> pids;
while ( c->more() ) {
BSONObj lock = c->next();