summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2016-08-18 16:18:34 -0400
committerMathias Stearn <redbeard0531@gmail.com>2016-10-17 14:36:31 -0400
commit99f8d760848b0be69b8934b00d33552b1295d5d9 (patch)
treeade355bb104c02de2b509b9e59e35c3f75e04f6b
parente207e1a4809742a5cd0bb456202c82ff82548a44 (diff)
downloadmongo-99f8d760848b0be69b8934b00d33552b1295d5d9.tar.gz
SERVER-25715 in shutdown, delete WiredTigerSessions w/o closing the underlying WT_SESSION
(cherry picked from commit 8018f3bedcb6fb321d1581a47e8c471b31526926)
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp
index 836d42b9e42..3debe9d4a1a 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp
@@ -272,10 +272,13 @@ void WiredTigerSessionCache::releaseSession(WiredTigerSession* session) {
ON_BLOCK_EXIT([this] { _shuttingDown.fetchAndSubtract(1); });
if (shuttingDown & kShuttingDownMask) {
- // Leak the session in order to avoid race condition with clean shutdown, where the
- // storage engine is ripped from underneath transactions, which are not "active"
- // (i.e., do not have any locks), but are just about to delete the recovery unit.
- // See SERVER-16031 for more information.
+ // There is a race condition with clean shutdown, where the storage engine is ripped from
+ // underneath OperationContexts, which are not "active" (i.e., do not have any locks), but
+ // are just about to delete the recovery unit. See SERVER-16031 for more information. Since
+ // shutting down the WT_CONNECTION will close all WT_SESSIONS, we shouldn't also try to
+ // directly close this session.
+ session->_session = nullptr; // Prevents calling _session->close() in destructor.
+ delete session;
return;
}