mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
debugging MINOR
This commit is contained in:
parent
de8efe0a2a
commit
52427e60eb
@ -141,4 +141,18 @@ namespace mongo {
|
||||
_client->_context = _oldContext; // note: _oldContext may be null
|
||||
}
|
||||
|
||||
string Client::toString() const {
|
||||
stringstream ss;
|
||||
if ( _curOp )
|
||||
ss << _curOp->infoNoauth().jsonString();
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
string sayClientState(){
|
||||
Client* c = currentClient.get();
|
||||
if ( ! c )
|
||||
return "no client";
|
||||
return c->toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -197,6 +197,8 @@ namespace mongo {
|
||||
bool isGod() const { return _god; }
|
||||
|
||||
friend class CurOp;
|
||||
|
||||
string toString() const;
|
||||
};
|
||||
|
||||
inline Client& cc() {
|
||||
@ -241,5 +243,7 @@ namespace mongo {
|
||||
}
|
||||
}
|
||||
|
||||
string sayClientState();
|
||||
|
||||
};
|
||||
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
namespace mongo {
|
||||
|
||||
string sayClientState();
|
||||
|
||||
/* mutex time stats */
|
||||
class MutexInfo {
|
||||
unsigned long long start, enter, timeLocked; // all in microseconds
|
||||
@ -89,7 +91,7 @@ namespace mongo {
|
||||
_state.set(s+1);
|
||||
return;
|
||||
}
|
||||
massert( 10293 , "internal error: locks are not upgradeable", s == 0 );
|
||||
massert( 10293 , (string)"internal error: locks are not upgradeable: " + sayClientState() , s == 0 );
|
||||
_state.set(1);
|
||||
_m.lock();
|
||||
_minfo.entered();
|
||||
|
Loading…
Reference in New Issue
Block a user