diff options
author | Anton Oyung <anton.oyung@mongodb.com> | 2019-10-17 16:03:36 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-17 16:03:36 +0000 |
commit | ac106264b40f3e125ed25de12c8d72102e5b7ac2 (patch) | |
tree | 5412d4bd629c6dd56b2c8df8257988ffb626deb1 /src | |
parent | ba799a620d8a93f4bcf2bfc450918810c734039e (diff) | |
download | mongo-ac106264b40f3e125ed25de12c8d72102e5b7ac2.tar.gz |
SERVER-40537 Log error code 261 for TooManyLogicalSessions to the mongodb.log
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/logical_session_cache_impl.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mongo/db/logical_session_cache_impl.cpp b/src/mongo/db/logical_session_cache_impl.cpp index 17b136f566a..61debaf9644 100644 --- a/src/mongo/db/logical_session_cache_impl.cpp +++ b/src/mongo/db/logical_session_cache_impl.cpp @@ -369,9 +369,15 @@ LogicalSessionCacheStats LogicalSessionCacheImpl::getStats() { Status LogicalSessionCacheImpl::_addToCache(WithLock, LogicalSessionRecord record) { if (_activeSessions.size() >= size_t(maxSessions)) { - return {ErrorCodes::TooManyLogicalSessions, - "Unable to add session into the cache because the number of active sessions is too " - "high"}; + Status status = {ErrorCodes::TooManyLogicalSessions, + str::stream() + << "Unable to add session ID " << record.getId() + << " into the cache because the number of active sessions is too " + "high"}; + auto severity = + MONGO_GET_LIMITED_SEVERITY(ErrorCodes::TooManyLogicalSessions, Seconds{1}, 0, 2); + LOG(severity) << status.toString(); + return status; } _activeSessions.insert(std::make_pair(record.getId(), std::move(record))); |