summaryrefslogtreecommitdiff
path: root/src/mongo/db/logical_session_cache_impl.cpp
diff options
context:
space:
mode:
authorMarcos José Grillo Ramírez <marcos.grillo@10gen.com>2019-10-30 16:03:52 +0000
committerevergreen <evergreen@mongodb.com>2019-10-30 16:03:52 +0000
commit46ab40ac2c604c2fb09488856cadbb751df2572f (patch)
treeb4c293b2ec28362b4c22e6449ac19946195ca68a /src/mongo/db/logical_session_cache_impl.cpp
parent1c4b9635631a8408b626fa9259d1c83860c0c054 (diff)
downloadmongo-46ab40ac2c604c2fb09488856cadbb751df2572f.tar.gz
SERVER-42508 Convert SessionsCollection to throw instead of return status
Change the remaining public functions: refreshSessions, removeRecords and findRemovedSessions
Diffstat (limited to 'src/mongo/db/logical_session_cache_impl.cpp')
-rw-r--r--src/mongo/db/logical_session_cache_impl.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mongo/db/logical_session_cache_impl.cpp b/src/mongo/db/logical_session_cache_impl.cpp
index a623b15e856..2d8834461ab 100644
--- a/src/mongo/db/logical_session_cache_impl.cpp
+++ b/src/mongo/db/logical_session_cache_impl.cpp
@@ -296,7 +296,7 @@ void LogicalSessionCacheImpl::_refresh(Client* client) {
}
// Refresh the active sessions in the sessions collection.
- uassertStatusOK(_sessionsColl->refreshSessions(opCtx, activeSessionRecords));
+ _sessionsColl->refreshSessions(opCtx, activeSessionRecords);
activeSessionsBackSwapper.dismiss();
{
stdx::lock_guard<Latch> lk(_mutex);
@@ -304,7 +304,7 @@ void LogicalSessionCacheImpl::_refresh(Client* client) {
}
// Remove the ending sessions from the sessions collection.
- uassertStatusOK(_sessionsColl->removeRecords(opCtx, explicitlyEndingSessions));
+ _sessionsColl->removeRecords(opCtx, explicitlyEndingSessions);
explicitlyEndingBackSwaper.dismiss();
{
stdx::lock_guard<Latch> lk(_mutex);
@@ -331,14 +331,13 @@ void LogicalSessionCacheImpl::_refresh(Client* client) {
}
// think about pruning ending and active out of openCursorSessions
- auto statusAndRemovedSessions = _sessionsColl->findRemovedSessions(opCtx, openCursorSessions);
+ try {
+ auto removedSessions = _sessionsColl->findRemovedSessions(opCtx, openCursorSessions);
- if (statusAndRemovedSessions.isOK()) {
- auto removedSessions = statusAndRemovedSessions.getValue();
for (const auto& lsid : removedSessions) {
patterns.emplace(makeKillAllSessionsByPattern(opCtx, lsid));
}
- } else {
+ } catch (...) {
// Ignore errors.
}