Skip to content

Commit efd4e45

Browse files
committed
Fix return value of rabbit_priority_queue:delete_crashed/1
According to the `rabbit_backing_queue` behavious it must always return `ok`, but it used to return a list of results one for each priority. That caused the below crash further up the call chain. ``` > rabbit_classic_queue:delete_crashed(Q) ** exception error: no case clause matching [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok] in function rabbit_classic_queue:delete_crashed/2 (rabbit_classic_queue.erl, line 516) ``` Other backing_queue implementations (`rabbit_variable_queue`) just exit with a badmatch upon error. This (very minor) issue is present since 3.13.0 when `rabbit_classic_queue:delete_crashed_in_backing_queue/1` was instroduced with Khepri in commit 5f0981c. Before that the result of `BQ:delete_crashed/1` was simply ignored.
1 parent 114a5c2 commit efd4e45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

deps/rabbit/src/rabbit_priority_queue.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ delete_crashed(Q) ->
187187
BQ = bq(),
188188
case priorities(Q) of
189189
none -> BQ:delete_crashed(Q);
190-
Ps -> [BQ:delete_crashed(mutate_name(P, Q)) || P <- Ps]
190+
Ps ->
191+
[ok = BQ:delete_crashed(mutate_name(P, Q)) || P <- Ps],
192+
ok
191193
end.
192194

193195
purge(State = #state{bq = BQ}) ->

0 commit comments

Comments
 (0)