Skip to content

Commit

Permalink
Add after clause to receive expression
Browse files Browse the repository at this point in the history
When doing parallel view compaction, make sure the
respective process terminates when it exceeds the
allowed period window and strict_window is set to
true.


git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1160966 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
fdmanana committed Aug 24, 2011
1 parent 624d660 commit 87095cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/couchdb/couch_compaction_daemon.erl
Expand Up @@ -144,6 +144,7 @@ maybe_compact_db(DbName, Config) ->
end),
ViewsMonRef = erlang:monitor(process, ViewsCompactPid);
false ->
ViewsCompactPid = nil,
ViewsMonRef = nil
end,
DbMonRef = erlang:monitor(process, DbCompactPid),
Expand Down Expand Up @@ -175,6 +176,12 @@ maybe_compact_db(DbName, Config) ->
receive
{'DOWN', ViewsMonRef, process, _, _Reason} ->
ok
after TimeLeft + 1000 ->
% Under normal circunstances, the view compaction process
% should have finished already.
erlang:demonitor(ViewsMonRef, [flush]),
unlink(ViewsCompactPid),
exit(ViewsCompactPid, kill)
end
end;
false ->
Expand Down

0 comments on commit 87095cc

Please sign in to comment.