Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Close view compaction file when compaction is canceled

Closes COUCHDB-1384
  • Loading branch information...
commit 12a593c61dc0f154f3ade65a50706a019103d680 1 parent c43fbc9
Filipe Manana authored January 19, 2012

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  src/couchdb/couch_view_group.erl
7  src/couchdb/couch_view_group.erl
@@ -168,7 +168,12 @@ handle_call({start_compact, CompactFun}, _From, #group_state{compactor_pid=nil}
168 168
     {ok, Fd} = open_index_file(compact, RootDir, DbName, GroupSig),
169 169
     NewGroup = reset_file(Db, Fd, DbName, Group),
170 170
     couch_db:close(Db),
171  
-    Pid = spawn_link(fun() -> CompactFun(Group, NewGroup, DbName) end),
  171
+    unlink(Fd),
  172
+    Pid = spawn_link(fun() ->
  173
+        link(Fd),
  174
+        CompactFun(Group, NewGroup, DbName),
  175
+        unlink(Fd)
  176
+    end),
172 177
     {reply, {ok, Pid}, State#group_state{compactor_pid = Pid}};
173 178
 handle_call({start_compact, _}, _From, State) ->
174 179
     %% compact already running, this is a no-op

0 notes on commit 12a593c

Please sign in to comment.
Something went wrong with that request. Please try again.