diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2015-04-20 13:25:36 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2015-04-25 12:50:52 +1000 |
commit | 6f09dd9dad5046510833f9f9dce5dea4522c6dec (patch) | |
tree | d35af1975653fca63a646ee595d0227d6e7f6b57 | |
parent | 1558eca2835e2ffa317975652a7a1c45edc56e7b (diff) | |
download | mongo-6f09dd9dad5046510833f9f9dce5dea4522c6dec.tar.gz |
Shut down the eviction server before closing file handles to avoid a race.
refs WT-1893
-rw-r--r-- | src/conn/conn_open.c | 4 | ||||
-rw-r--r-- | src/evict/evict_lru.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/conn/conn_open.c b/src/conn/conn_open.c index 86f62e176ad..e0e59dea8ba 100644 --- a/src/conn/conn_open.c +++ b/src/conn/conn_open.c @@ -116,6 +116,7 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn) WT_TRET(__wt_checkpoint_server_destroy(session)); WT_TRET(__wt_statlog_destroy(session, 1)); WT_TRET(__wt_sweep_destroy(session)); + WT_TRET(__wt_evict_destroy(session)); /* Close open data handles. */ WT_TRET(__wt_conn_dhandle_discard(session)); @@ -153,9 +154,6 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn) fh = SLIST_FIRST(&conn->fhlh); } - /* Shut down the eviction server thread. */ - WT_TRET(__wt_evict_destroy(session)); - /* Disconnect from shared cache - must be before cache destroy. */ WT_TRET(__wt_conn_cache_pool_destroy(session)); diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c index 62326015d2c..286abb4034a 100644 --- a/src/evict/evict_lru.c +++ b/src/evict/evict_lru.c @@ -211,6 +211,12 @@ __evict_server(void *arg) WT_ERR(__wt_verbose(session, WT_VERB_EVICTSERVER, "waking")); } + /* + * The evction server is shutting down: in case any trees are still + * open, clear walks now so that they can be closed. + */ + WT_ERR(__evict_clear_walks(session)); + WT_ERR(__wt_verbose( session, WT_VERB_EVICTSERVER, "cache eviction server exiting")); |