From 152f2b9bc20e4078173c69652b0bc54038528c75 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Sat, 9 Oct 2010 16:22:39 +0000 Subject: 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 --- src/couchdb/couch_view_group.erl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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]), -- cgit v1.2.3