mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
turn off profiling if have recusrive lock (DBDirectClient)
This commit is contained in:
parent
5bbbc78154
commit
130bfc3af7
@ -390,10 +390,15 @@ namespace mongo {
|
||||
if ( database && database->profile >= 1 ) {
|
||||
if ( database->profile >= 2 || ms >= 100 ) {
|
||||
// performance profiling is on
|
||||
string old_ns = cc().ns();
|
||||
lk.releaseAndWriteLock();
|
||||
resetClient(old_ns.c_str());
|
||||
profile(ss.str().c_str()+20/*skip ts*/, ms);
|
||||
if ( dbMutex.getState() > 1 || dbMutex.getState() < -1 ){
|
||||
out() << "warning: not profiling because recursive lock" << endl;
|
||||
}
|
||||
else {
|
||||
string old_ns = cc().ns();
|
||||
lk.releaseAndWriteLock();
|
||||
resetClient(old_ns.c_str());
|
||||
profile(ss.str().c_str()+20/*skip ts*/, ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user