summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-10-09 16:22:39 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-10-09 16:22:39 +0000
commit152f2b9bc20e4078173c69652b0bc54038528c75 (patch)
tree54aeb839e3261e22d2585ef73b14b4d2c1e79aeb /src
parentc9100a152be888507e21a80b8cfcf032fc36c856 (diff)
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/trunk@1006181 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 2e497ca0..962f4aae 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]),