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 | 15b0f9336087f8340cbd14183df2f6d4fb6b1a5d (patch) | |
| tree | 4dd263311b1b9d944cf2d2cf7f77a5924ec6ea4d /src | |
| parent | d7fce2536718e7d235297a8f7c81edc88902eea5 (diff) | |
| download | rabbitmq-server-git-15b0f9336087f8340cbd14183df2f6d4fb6b1a5d.tar.gz | |
work around OTP-7025
also simplify the match slightly
Diffstat (limited to 'src')
| -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 a8c54438a2..58b8d7d60a 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; |
