From 8427ebd948b142331de0883b6c3b7d03de479d9b Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Fri, 20 Aug 2010 14:24:31 -0400 Subject: avoid deadlocks when changing query_servers configs, BugzID 10679 --- apps/couch/src/couch_query_servers.erl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/couch/src/couch_query_servers.erl b/apps/couch/src/couch_query_servers.erl index 144b7494..a4850e86 100644 --- a/apps/couch/src/couch_query_servers.erl +++ b/apps/couch/src/couch_query_servers.erl @@ -224,12 +224,9 @@ with_ddoc_proc(#doc{id=DDocId,revs={Start, [DiskRev|_]}}=DDoc, Fun) -> end. init([]) -> - % read config and register for configuration changes - - % just stop if one of the config settings change. couch_server_sup - % will restart us and then we will pick up the new settings. - - ok = couch_config:register(fun ?MODULE:config_change/1), + % register async to avoid deadlock on restart_child + Self = self(), + spawn(couch_config, register, [fun ?MODULE:config_change/1, Self]), Langs = ets:new(couch_query_server_langs, [set, private]), PidProcs = ets:new(couch_query_server_pid_langs, [set, private]), -- cgit v1.2.3