summaryrefslogtreecommitdiff
path: root/apps/couch/src/couch_query_servers.erl
diff options
context:
space:
mode:
Diffstat (limited to 'apps/couch/src/couch_query_servers.erl')
-rw-r--r--apps/couch/src/couch_query_servers.erl9
1 files 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]),