summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-10-09 16:24:41 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-10-09 16:24:41 +0000
commit333d134c748fc3e991bd7afd6e6d08a9a1347672 (patch)
tree6c5660dee69a23b015241d7b4da263a016d4271a /src
parentb5948054619d1dc8598794b38e899f4660adc6de (diff)
Merged revision 1006181 from trunk:
Bug fix: when receiving the compact_done message, make sure the gen_server unlinks itself from the compactor process and purges the compactor's exit message from its mailbox. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1006182 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_view_group.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/couchdb/couch_view_group.erl b/src/couchdb/couch_view_group.erl
index 2db972fb..78810dc9 100644
--- a/src/couchdb/couch_view_group.erl
+++ b/src/couchdb/couch_view_group.erl
@@ -180,6 +180,7 @@ handle_cast({compact_done, #group{current_seq=NewSeq} = NewGroup},
group = #group{name=GroupId, fd=OldFd, sig=GroupSig} = Group,
init_args = {RootDir, DbName, _},
updater_pid = UpdaterPid,
+ compactor_pid = CompactorPid,
ref_counter = RefCounter
} = State,
@@ -201,6 +202,8 @@ handle_cast({compact_done, #group{current_seq=NewSeq} = NewGroup},
end,
%% cleanup old group
+ unlink(CompactorPid),
+ receive {'EXIT', CompactorPid, normal} -> ok after 0 -> ok end,
unlink(OldFd),
couch_ref_counter:drop(RefCounter),
{ok, NewRefCounter} = couch_ref_counter:start([NewGroup#group.fd]),