summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2008-12-21 19:40:59 +0000
committerMatthias Radestock <matthias@lshift.net>2008-12-21 19:40:59 +0000
commitae4f38aa29feb67c3aedf630078674197adbf22e (patch)
treef32f5b2d1b991c8fac17f73baf53d1a49c1ddbd6
parent69315f79746877333b130074389e77298ac18649 (diff)
downloadrabbitmq-server-bug20046.tar.gz
work around OTP-7025 in a second placebug20046
-rw-r--r--src/rabbit_exchange.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index 299747d1..213ba903 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, '_');