don't profile if db was closed in interim

This commit is contained in:
Eliot Horowitz
2010-02-09 00:48:02 -05:00
parent eefff3bcc4
commit 76ca6a2887
2 changed files with 19 additions and 3 deletions

View File

@@ -365,8 +365,13 @@ namespace mongo {
}
else {
mongolock lk(true);
Client::Context c( currentOp.getNS() );
profile(ss.str().c_str(), ms);
if ( dbHolder.isLoaded( nsToDatabase( currentOp.getNS() ) , dbpath ) ){
Client::Context c( currentOp.getNS() );
profile(ss.str().c_str(), ms);
}
else {
mongo::log() << "warning: not profiling because db went away - probably a close on: " << currentOp.getNS() << endl;
}
}
}