diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index 6d2fb37..f65ac56 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -1194,7 +1194,17 @@ namespace mongo { Timer mt; // go through each doc + long long int iter = 0; while ( cursor->ok() ) { + if (++iter % 1000 == 0) { + // try to yield lock regularly + ClientCursor::YieldLock yield (cursor.get()); + if ( ! yield.stillOk() ) { + break; + } + killCurrentOp.checkForInterrupt(); + } + if ( ! cursor->currentMatches() ) { cursor->advance(); continue;