summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-08-20 14:24:31 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-27 16:34:31 -0400
commit8427ebd948b142331de0883b6c3b7d03de479d9b (patch)
treedf63d3885b2d6090525ca1c25d7cd3bf0ff3b09e /apps
parent5e0522932b056eef77ef3a955aebbdadf7400a07 (diff)
avoid deadlocks when changing query_servers configs, BugzID 10679
Diffstat (limited to 'apps')
-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]),