diff options
| author | Matthias Radestock <matthias@lshift.net> | 2008-12-23 14:45:22 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2008-12-23 14:45:22 +0000 |
| commit | 3aff0636faece63d64adacac69dfc2a072dbbbb8 (patch) | |
| tree | 0cca7825f9c5ad371f2ca4e39c380e40a50753dc /src | |
| parent | 683e77b06c313bec5eaa236a277951801aab77c3 (diff) | |
| parent | 201c9d1ccfe9f97baed87f6eca80a0983d3c504d (diff) | |
| download | rabbitmq-server-git-3aff0636faece63d64adacac69dfc2a072dbbbb8.tar.gz | |
merge default into bug18557
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_channel.erl | 25 | ||||
| -rw-r--r-- | src/rabbit_exchange.erl | 14 |
2 files changed, 27 insertions, 12 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index c586df0260..4b0cf6d532 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -113,20 +113,23 @@ init(ProxyPid, [ReaderPid, WriterPid, Username, VHost]) -> consumer_mapping = dict:new()}. handle_message({method, Method, Content}, State) -> - case (catch handle_method(Method, Content, State)) of - {reply, Reply, NewState} -> - ok = rabbit_writer:send_command(NewState#ch.writer_pid, Reply), - NewState; - {noreply, NewState} -> - NewState; - stop -> - exit(normal); - {'EXIT', {amqp, Error, Explanation, none}} -> + try + case handle_method(Method, Content, State) of + {reply, Reply, NewState} -> + ok = rabbit_writer:send_command(NewState#ch.writer_pid, Reply), + NewState; + {noreply, NewState} -> + NewState; + stop -> + exit(normal) + end + catch + exit:{amqp, Error, Explanation, none} -> terminate({amqp, Error, Explanation, rabbit_misc:method_record_type(Method)}, State); - {'EXIT', Reason} -> - terminate(Reason, State) + _:Reason -> + terminate({Reason, erlang:get_stacktrace()}, State) end; handle_message(terminate, State) -> diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 299747d141..c8069e08ef 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -238,7 +238,19 @@ route(#exchange{name = Name, type = topic}, RoutingKey) -> %% TODO: This causes a full scan for each entry %% with the same exchange (see bug 19336) topic_matches(BindingKey, RoutingKey)]), - lookup_qpids(mnesia:async_dirty(fun qlc:e/1, [Query])); + lookup_qpids( + try + mnesia:async_dirty(fun qlc:e/1, [Query]) + catch exit:{aborted, {badarg, _}} -> + %% work around OTP-7025, which was fixed in R12B-1, by + %% falling back on a less efficient method + [QName || #route{binding = #binding{queue_name = QName, + key = BindingKey}} <- + mnesia:dirty_match_object( + #route{binding = #binding{exchange_name = Name, + _ = '_'}}), + topic_matches(BindingKey, RoutingKey)] + end); route(X = #exchange{type = fanout}, _) -> route_internal(X, '_'); |
