summaryrefslogtreecommitdiff
path: root/src/mongo/db/logical_session_cache_impl.cpp
diff options
context:
space:
mode:
authorAnton Oyung <anton.oyung@mongodb.com>2019-10-17 16:03:36 +0000
committerevergreen <evergreen@mongodb.com>2019-10-17 16:03:36 +0000
commitac106264b40f3e125ed25de12c8d72102e5b7ac2 (patch)
tree5412d4bd629c6dd56b2c8df8257988ffb626deb1 /src/mongo/db/logical_session_cache_impl.cpp
parentba799a620d8a93f4bcf2bfc450918810c734039e (diff)
downloadmongo-ac106264b40f3e125ed25de12c8d72102e5b7ac2.tar.gz
SERVER-40537 Log error code 261 for TooManyLogicalSessions to the mongodb.log
Diffstat (limited to 'src/mongo/db/logical_session_cache_impl.cpp')
-rw-r--r--src/mongo/db/logical_session_cache_impl.cpp12
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)));