diff options
author | Ian Boros <ian.boros@mongodb.com> | 2019-09-06 16:36:37 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-06 16:36:37 +0000 |
commit | 19509c977c96ded7b3e7c954fc5f8885065a0d9f (patch) | |
tree | 4b176a86505494dd30e4f435e41c3517903f27fa /src | |
parent | 84c970a8cc571df2ba5482cc059c2644ac420ad8 (diff) | |
download | mongo-19509c977c96ded7b3e7c954fc5f8885065a0d9f.tar.gz |
SERVER-40110 don't call OpContext::checkForInterrupt() off-thread
This commit also includes a modification to the test done under SERVER-43156.
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/s/query/cluster_cursor_manager.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/s/query/cluster_cursor_manager.h b/src/mongo/s/query/cluster_cursor_manager.h index 88d89a7704b..3998f7cf00d 100644 --- a/src/mongo/s/query/cluster_cursor_manager.h +++ b/src/mongo/s/query/cluster_cursor_manager.h @@ -579,8 +579,13 @@ private: bool isKillPending() const { // A cursor is kill pending if it's checked out by an OperationContext that was // interrupted. - return _operationUsingCursor && - !_operationUsingCursor->checkForInterruptNoAssert().isOK(); + if (!_operationUsingCursor) { + return false; + } + + // Must hold the Client lock when calling isKillPending(). + stdx::unique_lock<Client> lk(*_operationUsingCursor->getClient()); + return _operationUsingCursor->isKillPending(); } CursorType getCursorType() const { |