[SERVER-11432] Audit usage of checkForInterrupt(false) Created: 28/Oct/13  Updated: 02/Aug/18  Resolved: 25/Feb/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 2.6.0-rc1

Type: Task Priority: Major - P3
Reporter: J Rassi Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-11038 Interrupting renameCollection via shu... Closed
Related
is related to SERVER-12607 Write commands should be interruptabl... Closed
is related to SERVER-11370 applyOps should not allow yields Closed
Participants:

 Description   

Audit callers of checkForInterrupt(false), to identify scenarios where releasing a write lock from an interruption could violate the write semantics of the associated operation.



 Comments   
Comment by Githook User [ 25/Feb/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-11432 PageFaultRetryableSection shouldn't set hasWrittenThisOp
Branch: master
https://github.com/mongodb/mongo/commit/3c70a417f2442c40ad60e290edc02a9c43806a94

Comment by Githook User [ 24/Feb/14 ]

Author:

{u'username': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: SERVER-11432: clean up some killCurrentOp.checkForInterrupt handling
Branch: master
https://github.com/mongodb/mongo/commit/0c61493cd36a7aef42713af1cb2c14a23ccff746

Comment by Eliot Horowitz (Inactive) [ 18/Feb/14 ]

Patch build for removing from staticYield:
http://mci.10gen.com/ui/version/5303593b3ff122667900000b_0

diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp
index 8dd2a34..f9a1c43 100644
--- a/src/mongo/db/clientcursor.cpp
+++ b/src/mongo/db/clientcursor.cpp
@@ -167,7 +167,7 @@ namespace mongo {
     void ClientCursor::staticYield(int micros, const StringData& ns, const Record* rec) {
         bool haveReadLock = Lock::isReadLocked();
 
-        killCurrentOp.checkForInterrupt( false );
+        killCurrentOp.checkForInterrupt();
         {
             auto_ptr<LockMongoFilesShared> lk;
             if ( rec ) {

Comment by J Rassi [ 28/Oct/13 ]

As of c86a094c97b97de8b34f6bba66068df470ff4d10, 2.5.4-pre- (today), generated by manually filtering from a grep for "checkForInterrupt":

BtreeBucket<V>::fullValidate()
src/mongo/db/btreebuilder.cpp:126:                killCurrentOp.checkForInterrupt( !mayInterrupt );
 
ClientCursor::staticYield()
src/mongo/db/clientcursor.cpp:379:        killCurrentOp.checkForInterrupt( false );
 
mayInterrupt()
src/mongo/db/cloner.cpp:66:         	killCurrentOp.checkForInterrupt( false );
 
compactExtent()
src/mongo/db/compact.cpp:163:                        killCurrentOp.checkForInterrupt(false);
 
_compact()
src/mongo/db/compact.cpp:286:            killCurrentOp.checkForInterrupt(false);
 
RecoveryJob::processFileBuffer()
src/mongo/db/dur_recover.cpp:488:                    killCurrentOp.checkForInterrupt(false);
 
OldExtSortComparator::operator()
src/mongo/db/extsort.cpp:67:                    killCurrentOp.checkForInterrupt(!*_mayInterrupt);
 
BSONObjExternalSorter::extSortComp()
src/mongo/db/extsort.cpp:117:        RARELY killCurrentOp.checkForInterrupt(!extSortMayInterrupt);
 
buildBottomUpPhases2And3()
src/mongo/db/index/btree_based_builder.cpp:95:            RARELY killCurrentOp.checkForInterrupt( !mayInterrupt );
 
BtreeBasedBuilder::addKeysToPhaseOne()
src/mongo/db/index/btree_based_builder.cpp:173:            RARELY killCurrentOp.checkForInterrupt( !mayInterrupt );
 
BtreeBasedBuilder::doDropDups()
src/mongo/db/index/btree_based_builder.cpp:271:            RARELY killCurrentOp.checkForInterrupt( !mayInterrupt );
 
touchNs()
src/mongo/util/touch_pages.cpp:71:            killCurrentOp.checkForInterrupt(false);

Generated at Thu Feb 08 03:25:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.