From c1ba70c38adef885ee50687210732c3999951a08 Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Fri, 2 Apr 2010 20:01:11 +0000 Subject: Deterministic/synchronous shutdown code. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@930363 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_view.erl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/couchdb/couch_view.erl') diff --git a/src/couchdb/couch_view.erl b/src/couchdb/couch_view.erl index cbbbd4ac..234460ce 100644 --- a/src/couchdb/couch_view.erl +++ b/src/couchdb/couch_view.erl @@ -269,8 +269,9 @@ init([]) -> {ok, #server{root_dir=RootDir}}. -terminate(Reason, _Srv) -> - couch_util:terminate_linked(Reason), +terminate(_Reason, _Srv) -> + [couch_util:shutdown_sync(Pid) || {Pid, _} <- + ets:tab2list(couch_groups_by_updater)], ok. @@ -311,10 +312,7 @@ do_reset_indexes(DbName, Root) -> fun({_DbName, Sig}) -> ?LOG_DEBUG("Killing update process for view group ~s. in database ~s.", [Sig, DbName]), [{_, Pid}] = ets:lookup(group_servers_by_sig, {DbName, Sig}), - exit(Pid, kill), - receive {'EXIT', Pid, _} -> - delete_from_ets(Pid, DbName, Sig) - end + couch_util:shutdown_sync(Pid) end, Names), delete_index_dir(Root, DbName), file:delete(Root ++ "/." ++ ?b2l(DbName) ++ "_temp"). -- cgit v1.2.3