Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

backport of fix for cursor timeout iteration, from jira discussion SE…

…RVER-3996
  • Loading branch information...
commit 85902e0e826ba543f9ea6021e0d370fcc6dd6854 1 parent 58a3ee1
gregs authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 s/cursors.cpp
View
7 s/cursors.cpp
@@ -265,13 +265,16 @@ namespace mongo {
void CursorCache::doTimeouts() {
long long now = Listener::getElapsedTimeMillis();
scoped_lock lk( _mutex );
- for ( MapSharded::iterator i=_cursors.begin(); i!=_cursors.end(); ++i ) {
+ MapSharded::iterator i=_cursors.begin();
+ while ( i!=_cursors.end() ) {
+
long long idleFor = i->second->idleTime( now );
if ( idleFor < TIMEOUT ) {
+ ++i;
continue;
}
log() << "killing old cursor " << i->second->getId() << " idle for: " << idleFor << "ms" << endl; // TODO: make log(1)
- _cursors.erase( i );
+ _cursors.erase( i++ );
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.