diff options
author | Matthias Radestock <matthias@lshift.net> | 2008-11-19 15:12:46 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2008-11-19 15:12:46 +0000 |
commit | ccb875c6ec4e00732943eab3834b9e366b31fde2 (patch) | |
tree | 4dd263311b1b9d944cf2d2cf7f77a5924ec6ea4d /src/rabbit_exchange.erl | |
parent | 4592f45b4b84f4190800fc9ec6f32a497655bc0a (diff) | |
download | rabbitmq-server-ccb875c6ec4e00732943eab3834b9e366b31fde2.tar.gz |
work around OTP-7025bug19522
also simplify the match slightly
Diffstat (limited to 'src/rabbit_exchange.erl')
-rw-r--r-- | src/rabbit_exchange.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index a8c54438..58b8d7d6 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -268,9 +268,17 @@ exchanges_for_queue(QueueName) -> has_bindings(ExchangeName) -> MatchHead = #route{binding = #binding{exchange_name = ExchangeName, - queue_name = '$1', _ = '_'}}, - continue(mnesia:select(route, [{MatchHead, [], ['$1']}], 1, read)). + try + continue(mnesia:select(route, [{MatchHead, [], ['$_']}], 1, read)) + catch exit:{aborted, {badarg, _}} -> + %% work around OTP-7025, which was fixed in R12B-1, by + %% falling back on a less efficient method + case mnesia:match_object(MatchHead) of + [] -> false; + [_|_] -> true + end + end. continue('$end_of_table') -> false; continue({[_|_], _}) -> true; |