Skip to content

Commit 114eab5

Browse files
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. (cherry picked from commit 62b40f7)
1 parent 671145d commit 114eab5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/rabbit_amqqueue.erl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,9 @@
178178
-spec notify_decorators(rabbit_types:amqqueue()) -> 'ok'.
179179
-spec resume(pid(), pid()) -> 'ok'.
180180
-spec internal_delete(name(), rabbit_types:username()) ->
181-
rabbit_types:ok_or_error('not_found') |
182-
rabbit_types:connection_exit() |
181+
'ok' | rabbit_types:connection_exit() |
183182
fun (() ->
184-
rabbit_types:ok_or_error('not_found') |
185-
rabbit_types:connection_exit()).
183+
'ok' | rabbit_types:connection_exit()).
186184
-spec run_backing_queue
187185
(pid(), atom(), (fun ((atom(), A) -> {[rabbit_types:msg_id()], A}))) ->
188186
'ok'.
@@ -995,7 +993,7 @@ internal_delete(QueueName, ActingUser, Reason) ->
995993
case {mnesia:wread({rabbit_queue, QueueName}),
996994
mnesia:wread({rabbit_durable_queue, QueueName})} of
997995
{[], []} ->
998-
rabbit_misc:const({error, not_found});
996+
rabbit_misc:const(ok);
999997
_ ->
1000998
Deletions = internal_delete1(QueueName, false, Reason),
1001999
T = rabbit_binding:process_deletions(Deletions,

0 commit comments

Comments
 (0)