You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2010/10/09 18:22:39 UTC
svn commit: r1006181 - /couchdb/trunk/src/couchdb/couch_view_group.erl
Author: fdmanana
Date: Sat Oct 9 16:22:39 2010
New Revision: 1006181
URL: http://svn.apache.org/viewvc?rev=1006181&view=rev
Log:
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.
Modified:
couchdb/trunk/src/couchdb/couch_view_group.erl
Modified: couchdb/trunk/src/couchdb/couch_view_group.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_view_group.erl?rev=1006181&r1=1006180&r2=1006181&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_view_group.erl (original)
+++ couchdb/trunk/src/couchdb/couch_view_group.erl Sat Oct 9 16:22:39 2010
@@ -180,6 +180,7 @@ handle_cast({compact_done, #group{curren
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{curren
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]),