diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-03-18 09:23:42 -0700 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-03-18 09:23:42 -0700 |
commit | 2c76df0a1c784227558bce52b46f6c6f5df5fd5c (patch) | |
tree | f67a3bb9ad774013ade6d16e161a92ab29d8c745 /src | |
parent | f67c917a34727e82c20cb5ee0aa115559076f9ea (diff) | |
parent | c74d5b6027268219f5f574910967ed7b5320e5be (diff) | |
download | mongo-2c76df0a1c784227558bce52b46f6c6f5df5fd5c.tar.gz |
Merge pull request #482 from wiredtiger/open-cleanup
Try harder to cleanup after a failed wiredtiger_open call.
Diffstat (limited to 'src')
-rw-r--r-- | src/conn/conn_api.c | 2 | ||||
-rw-r--r-- | src/conn/conn_cache_pool.c | 10 | ||||
-rw-r--r-- | src/txn/txn.c | 3 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c index 3e64e63107a..7b8eeb05600 100644 --- a/src/conn/conn_api.c +++ b/src/conn/conn_api.c @@ -991,7 +991,7 @@ err: if (cbuf != NULL) __wt_buf_free(session, &exconfig); if (ret != 0 && conn != NULL) - WT_TRET(__wt_connection_destroy(conn)); + WT_TRET(__wt_connection_close(conn)); /* Let the server threads proceed. */ if (ret == 0) diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c index d570c6b3593..02f54e8bad0 100644 --- a/src/conn/conn_cache_pool.c +++ b/src/conn/conn_cache_pool.c @@ -254,7 +254,15 @@ __wt_conn_cache_pool_destroy(WT_CONNECTION_IMPL *conn) cp->currently_used -= conn->cache_size; } - WT_ASSERT(session, cp->refs > 0); + /* + * If there are no references, we are cleaning up after a failed + * wiredtiger_open, there is nothing further to do. + */ + if (cp->refs < 1) { + __wt_spin_unlock(session, &cp->cache_pool_lock); + return (0); + } + if (--cp->refs == 0) { WT_ASSERT(session, TAILQ_EMPTY(&cp->cache_pool_qh)); F_CLR(cp, WT_CACHE_POOL_RUN); diff --git a/src/txn/txn.c b/src/txn/txn.c index 2b0bef4f44f..f3bf4831d46 100644 --- a/src/txn/txn.c +++ b/src/txn/txn.c @@ -461,5 +461,6 @@ __wt_txn_global_destroy(WT_CONNECTION_IMPL *conn) session = conn->default_session; txn_global = &conn->txn_global; - __wt_free(session, txn_global->states); + if (txn_global != NULL) + __wt_free(session, txn_global->states); } |