summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2015-02-24 17:38:19 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2015-02-24 17:38:19 +1100
commit468ebeee06ee6ddd6360c51132b6dd3c5b93064a (patch)
treee12d7c810d3ea11a852b9369c453b6ecc6448a81
parent66d4c3786e8de724232ce3f2edacc44ff74a4a05 (diff)
downloadmongo-468ebeee06ee6ddd6360c51132b6dd3c5b93064a.tar.gz
Pre-allocate space for eviction workers to close a window where opening new sessions can race with WT_CONNECTION::close.
refs #1680
-rw-r--r--src/evict/evict_lru.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index 35be3df9185..e3d8ea6a4e0 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -284,11 +284,17 @@ __wt_evict_create(WT_SESSION_IMPL *session)
session = conn->evict_session;
/*
+ * If eviction workers were configured, allocate sessions for them now.
+ * This is done to reduce the chance that we will open new eviction
+ * sessions after WT_CONNECTION::close is called.
+ *
* If there's only a single eviction thread, it may be called upon to
* perform slow operations for the block manager. (The flag is not
* reset if reconfigured later, but I doubt that's a problem.)
*/
- if (conn->evict_workers_max == 0)
+ if (conn->evict_workers_max > 0)
+ WT_RET(__evict_workers_resize(session));
+ else
F_SET(session, WT_SESSION_CAN_WAIT);
/*