summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2018-08-30 11:22:15 +0300
committerMichael Klishin <mklishin@pivotal.io>2018-08-30 11:22:15 +0300
commit62b40f7e03f9a176f5de8bd27b5795085da741c7 (patch)
tree86fef6f30700e145bc8826a9cbb436dec9d90845
parent606b101d1e2d8988200d013999a5348169bfd7b2 (diff)
downloadrabbitmq-server-git-62b40f7e03f9a176f5de8bd27b5795085da741c7.tar.gz
Don't error when a queue that's being deleted has no bindings to remove
It can happen due to retries of (currently not guaranteed to be idempotent, which is a separate issue in the works) binding removal. Since both the queue and its bindings are undergoing removal, don't fail when there's nothing left to be removed for the current transaction [attempt]. This avoids obscure and non-actionable errors in the log ({error, not_found}). Note that the error is also not handled by the callers and ignoring them is the only reasonable course of action that I can think of. Per discussion with @dumbbell @dcorbacho @hairyhum.
-rw-r--r--src/rabbit_amqqueue.erl8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index 5285689b58..ca4fb1c019 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -178,11 +178,9 @@
-spec notify_decorators(rabbit_types:amqqueue()) -> 'ok'.
-spec resume(pid(), pid()) -> 'ok'.
-spec internal_delete(name(), rabbit_types:username()) ->
- rabbit_types:ok_or_error('not_found') |
- rabbit_types:connection_exit() |
+ 'ok' | rabbit_types:connection_exit() |
fun (() ->
- rabbit_types:ok_or_error('not_found') |
- rabbit_types:connection_exit()).
+ 'ok' | rabbit_types:connection_exit()).
-spec run_backing_queue
(pid(), atom(), (fun ((atom(), A) -> {[rabbit_types:msg_id()], A}))) ->
'ok'.
@@ -995,7 +993,7 @@ internal_delete(QueueName, ActingUser, Reason) ->
case {mnesia:wread({rabbit_queue, QueueName}),
mnesia:wread({rabbit_durable_queue, QueueName})} of
{[], []} ->
- rabbit_misc:const({error, not_found});
+ rabbit_misc:const(ok);
_ ->
Deletions = internal_delete1(QueueName, false, Reason),
T = rabbit_binding:process_deletions(Deletions,