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:24:41 UTC

svn commit: r1006182 - /couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl

Author: fdmanana
Date: Sat Oct  9 16:24:41 2010
New Revision: 1006182

URL: http://svn.apache.org/viewvc?rev=1006182&view=rev
Log:
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.


Modified:
    couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl

Modified: couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl?rev=1006182&r1=1006181&r2=1006182&view=diff
==============================================================================
--- couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl (original)
+++ couchdb/branches/1.0.x/src/couchdb/couch_view_group.erl Sat Oct  9 16:24:41 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]),