0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-28 07:59:02 +01:00

SERVER-17699 LockerImpl<>::getLockerInfo() don't no-op if not locked

This commit is contained in:
Jason Rassi 2015-03-23 13:21:31 -04:00
parent b17c75a2c0
commit d5f0d74d5c
2 changed files with 5 additions and 16 deletions

View File

@ -1,4 +1,3 @@
if (0) { // TODO SERVER-16799 reenable
// Check debug information recorded for a query.
// special db so that it can be run in parallel tests
@ -50,26 +49,19 @@ try {
[ "nreturned", 0 ],
[ "responseLength", 20 ] ] );
t.save( {} );
// check write lock stats are set
t.save( {} );
o = lastOp();
assert.eq('insert', o.op);
printjson( o );
assert.eq( 0, o.lockStats.timeLockedMicros.r );
assert.lt( 0, o.lockStats.timeLockedMicros.w );
assert.eq( 0, o.lockStats.timeAcquiringMicros.r );
assert.lte( 0, o.lockStats.timeAcquiringMicros.w );
printjson(o.locks);
assert.lt( 0, Object.keys(o.locks).length );
// check read lock stats are set
t.find();
o = lastOp();
assert.eq('query', o.op);
assert.lt( 0, o.lockStats.timeLockedMicros.r );
assert.eq( 0, o.lockStats.timeLockedMicros.w );
assert.lte( 0, o.lockStats.timeAcquiringMicros.r );
assert.lte( 0, o.lockStats.timeAcquiringMicros.w );
printjson(o.locks);
assert.lt( 0, Object.keys(o.locks).length );
t.save( {} );
t.save( {} );
@ -119,4 +111,3 @@ finally {
db.setProfilingLevel(0);
db = stddb;
}
}

View File

@ -502,8 +502,6 @@ namespace {
lockerInfo->waitingResource = ResourceId();
lockerInfo->stats.reset();
if (!isLocked()) return;
_lock.lock();
LockRequestsMap::ConstIterator it = _requests.begin();
while (!it.finished()) {