Skip to content

Commit 000cc32

Browse files
committed
Handle generic data structures in priority queue info callback
The priority queue implementation makes assumptions over the data format returned by the underlying backing queue `info` callback. This causes priority queues to crash if used together with other modules implementing the `rabbit_backing_queue` behaviour and returning additional data with the `info` callback. As we cannot predict the format of the data the backing queue `info` callback could return, we just replace it with the undefined keyword. Signed-off-by: Matteo Cafasso <[email protected]>
1 parent 7af8fd2 commit 000cc32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rabbit_priority_queue.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ cse(_, lazy) -> lazy;
666666
cse(lazy, _) -> lazy;
667667
%% numerical stats
668668
cse(A, B) when is_number(A) -> A + B;
669-
cse({delta, _, _, _, _}, _) -> {delta, todo, todo, todo, todo};
670-
cse(A, B) -> exit({A, B}).
669+
cse({delta, _, _, _, _}, _) -> {delta, todo, todo, todo, todo};
670+
cse(_, _) -> undefined.
671671

672672
%% When asked about 'head_message_timestamp' fro this priority queue, we
673673
%% walk all the backing queues, starting by the highest priority. Once a

0 commit comments

Comments
 (0)