mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
[SERVER-1992]: check if currentClient is 0, which can happen in mongos
This commit is contained in:
parent
7c3be2b805
commit
2560f2c291
@ -649,8 +649,8 @@ namespace mongo {
|
||||
changeID = id.str();
|
||||
|
||||
// send a copy of the message to the log in case it doesn't manage to reach config.changelog
|
||||
Client& c = cc();
|
||||
BSONObj msg = BSON( "_id" << changeID << "server" << getHostNameCached() << "clientAddr" << c.clientAddress(true)
|
||||
Client* c = currentClient.get();
|
||||
BSONObj msg = BSON( "_id" << changeID << "server" << getHostNameCached() << "clientAddr" << (c ? c->clientAddress(true) : "N/A")
|
||||
<< "time" << DATENOW << "what" << what << "ns" << ns << "details" << detail );
|
||||
log() << "about to log metadata event: " << msg << endl;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user