diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2015-11-22 21:38:27 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2015-11-22 21:41:07 +0300 |
| commit | db28a261c7a54642a177f558507e10294106fca5 (patch) | |
| tree | 17f60ffe80b445304c1335775e1b68b71b2d79ed /src | |
| parent | a524f6f0aa95c1a3692dae11de9624db1fd36084 (diff) | |
| download | rabbitmq-server-git-db28a261c7a54642a177f558507e10294106fca5.tar.gz | |
Handle cases where Ranch wasn't yet started
Fixes #443.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_vm.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rabbit_vm.erl b/src/rabbit_vm.erl index 4f160defbb..50b60509e2 100644 --- a/src/rabbit_vm.erl +++ b/src/rabbit_vm.erl @@ -135,9 +135,17 @@ interesting_sups0() -> [MsgIndexProcs, MgmtDbProcs, PluginProcs]. conn_sups() -> - Ranches = lists:flatten(ets:match(ranch_server, {{conns_sup, '_'}, '$1'})), + Ranches = lists:flatten(ranch_server_sups()), [amqp_sup|Ranches]. +ranch_server_sups() -> + try + ets:match(ranch_server, {{conns_sup, '_'}, '$1'}) + catch + %% Ranch ETS table doesn't exist yet + error:badarg -> [] + end. + conn_sups(With) -> [{Sup, With} || Sup <- conn_sups()]. distinguishers() -> [{rabbit_amqqueue_sup_sup, fun queue_type/1} | |
