summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_db_updater.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2010-04-28 16:54:26 +0000
committerDamien F. Katz <damien@apache.org>2010-04-28 16:54:26 +0000
commit6b26fd1f09be1e50c7c17d6fcc8f61f1c1a4ba37 (patch)
tree38a7cb967c5f2a8ce90e70a94d8e2a4ea79743c5 /src/couchdb/couch_db_updater.erl
parent1f919c38279deeeae69baf01f801017f7de45f9f (diff)
Fix to make dbclose synchronous, to prevent unnecessary slowdown caused by many already completed client requests having a single db open, and the vm waiting a long time to asynchronously process the close messages.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@939009 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_db_updater.erl')
-rw-r--r--src/couchdb/couch_db_updater.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/couchdb/couch_db_updater.erl b/src/couchdb/couch_db_updater.erl
index b9945e3b..efa44895 100644
--- a/src/couchdb/couch_db_updater.erl
+++ b/src/couchdb/couch_db_updater.erl
@@ -856,8 +856,8 @@ start_copy_compact(#db{name=Name,filepath=Filepath}=Db) ->
ok = couch_file:write_header(Fd, Header=#db_header{})
end,
NewDb = init_db(Name, CompactFile, Fd, Header),
+ unlink(Fd),
NewDb2 = copy_compact(Db, NewDb, Retry),
-
- gen_server:cast(Db#db.update_pid, {compact_done, CompactFile}),
- close_db(NewDb2).
+ close_db(NewDb2),
+ gen_server:cast(Db#db.update_pid, {compact_done, CompactFile}).