diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-12-19 17:19:58 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-12-19 17:19:58 +1100 |
commit | e913b0811114d65b543cd78824e809eb487fd330 (patch) | |
tree | 8e2a1af3544141cc43069346193868b8e3923381 | |
parent | 0d21e437917bc7cf08393852a3074957431ea30e (diff) | |
download | mongo-e913b0811114d65b543cd78824e809eb487fd330.tar.gz |
Check that handles are not being walked by eviction before discarding.
refs #1497
-rw-r--r-- | src/conn/conn_dhandle.c | 3 | ||||
-rw-r--r-- | src/conn/conn_sweep.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c index 5d5a67ccac8..6d331f691fd 100644 --- a/src/conn/conn_dhandle.c +++ b/src/conn/conn_dhandle.c @@ -667,7 +667,8 @@ __conn_dhandle_remove(WT_SESSION_IMPL *session, int final) WT_ASSERT(session, F_ISSET(session, WT_SESSION_HANDLE_LIST_LOCKED)); /* Check if the handle was reacquired by a session while we waited. */ - if (!final && dhandle->session_ref != 0) + if (!final && + (dhandle->session_inuse != 0 || dhandle->session_ref != 0)) return (EBUSY); WT_CONN_DHANDLE_REMOVE(conn, dhandle, bucket); diff --git a/src/conn/conn_sweep.c b/src/conn/conn_sweep.c index afb84472a18..5916043e44f 100644 --- a/src/conn/conn_sweep.c +++ b/src/conn/conn_sweep.c @@ -79,7 +79,7 @@ __sweep(WT_SESSION_IMPL *session) * re-checks that the handle is not in use, which is why we * don't do any special handling of EBUSY returns above. */ - if (dhandle->session_ref == 0) { + if (dhandle->session_inuse == 0 && dhandle->session_ref == 0) { WT_WITH_DHANDLE(session, dhandle, ret = __wt_conn_dhandle_discard_single(session, 0)); if (ret != 0) |