summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2015-07-29 11:00:46 +0300
committerMichael Klishin <mklishin@pivotal.io>2015-07-29 11:00:46 +0300
commitc3088e96e2b808676b87801940f0e77ba487755a (patch)
treeaeb77cfc0a0460ba2e11eb860d95fc3eb3c07402
parentf8e8c2fe117179adf7cf091acd75c5d21651b332 (diff)
parentac5373f34ec1dac6ad338d14580d28c7c2d4132e (diff)
downloadrabbitmq-server-git-c3088e96e2b808676b87801940f0e77ba487755a.tar.gz
Merge branch 'stable'
-rw-r--r--src/rabbit_exchange_type_topic.erl19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/rabbit_exchange_type_topic.erl b/src/rabbit_exchange_type_topic.erl
index afbfc652b1..53fb762539 100644
--- a/src/rabbit_exchange_type_topic.erl
+++ b/src/rabbit_exchange_type_topic.erl
@@ -76,11 +76,14 @@ remove_bindings(transaction, _X, Bs) ->
rabbit_topic_trie_edge,
rabbit_topic_trie_binding]]
end,
- [begin
- Path = [{FinalNode, _} | _] =
- follow_down_get_path(X, split_topic_key(K)),
- trie_remove_binding(X, FinalNode, D, Args),
- remove_path_if_empty(X, Path)
+ [case follow_down_get_path(X, split_topic_key(K)) of
+ {ok, Path = [{FinalNode, _} | _]} ->
+ trie_remove_binding(X, FinalNode, D, Args),
+ remove_path_if_empty(X, Path);
+ {error, _Node, _RestW} ->
+ %% We're trying to remove a binding that no longer exists.
+ %% That's unexpected, but shouldn't be a problem.
+ ok
end || #binding{source = X, key = K, destination = D, args = Args} <- Bs],
ok;
remove_bindings(none, _X, _Bs) ->
@@ -137,10 +140,8 @@ follow_down_last_node(X, Words) ->
follow_down(X, fun (_, Node, _) -> Node end, root, Words).
follow_down_get_path(X, Words) ->
- {ok, Path} =
- follow_down(X, fun (W, Node, PathAcc) -> [{Node, W} | PathAcc] end,
- [{root, none}], Words),
- Path.
+ follow_down(X, fun (W, Node, PathAcc) -> [{Node, W} | PathAcc] end,
+ [{root, none}], Words).
follow_down(X, AccFun, Acc0, Words) ->
follow_down(X, root, AccFun, Acc0, Words).