Skip to content

Commit

Permalink
SERVER-4712 check that query results are valid before using in case o…
Browse files Browse the repository at this point in the history
…f conn error
  • Loading branch information
Greg Studer authored and erh committed Feb 1, 2012
1 parent 527d4d2 commit 9a09c9f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/distlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9a09c9f

Please sign in to comment.