From 9fd4a06fcb563df24689c3e87b8d38e6242c230a Mon Sep 17 00:00:00 2001 From: Emile Joubert Date: Mon, 17 Jun 2013 14:01:51 +0100 Subject: Check value when clients update flying_ets --- src/rabbit_msg_store.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index c63321b5..35c0239f 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -627,7 +627,10 @@ client_update_flying(Diff, MsgId, #client_msstate { flying_ets = FlyingEts, Key = {MsgId, CRef}, case ets:insert_new(FlyingEts, {Key, Diff}) of true -> ok; - false -> try ets:update_counter(FlyingEts, Key, {2, Diff}) + false -> try ets:update_counter(FlyingEts, Key, {2, Diff}) of + 0 -> ok; + Diff -> ok; + Err -> throw({unexpected_flying_ets_counter, Diff, Err}) catch error:badarg -> %% this is guaranteed to succeed since the %% server only removes and updates flying_ets -- cgit v1.2.1