summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatteo Cafasso <noxdafox@gmail.com>2018-08-12 22:53:12 +0300
committerMatteo Cafasso <noxdafox@gmail.com>2018-08-12 22:53:12 +0300
commit000cc324c651ed019ed6ccb5ddcaabb5648a5721 (patch)
tree6b3c536a5b6d2e2ee2d05b03747e23d9061ab99e /src
parent7af8fd244c5d5059ac0b3d2931dcbc7210754d55 (diff)
downloadrabbitmq-server-git-000cc324c651ed019ed6ccb5ddcaabb5648a5721.tar.gz
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 <noxdafox@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_priority_queue.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rabbit_priority_queue.erl b/src/rabbit_priority_queue.erl
index b1eb83dddc..7b75dd4afd 100644
--- a/src/rabbit_priority_queue.erl
+++ b/src/rabbit_priority_queue.erl
@@ -666,8 +666,8 @@ cse(_, lazy) -> lazy;
cse(lazy, _) -> lazy;
%% numerical stats
cse(A, B) when is_number(A) -> A + B;
-cse({delta, _, _, _, _}, _) -> {delta, todo, todo, todo, todo};
-cse(A, B) -> exit({A, B}).
+cse({delta, _, _, _, _}, _) -> {delta, todo, todo, todo, todo};
+cse(_, _) -> undefined.
%% When asked about 'head_message_timestamp' fro this priority queue, we
%% walk all the backing queues, starting by the highest priority. Once a