diff options
author | Emile Joubert <emile@rabbitmq.com> | 2013-06-17 14:01:51 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2013-06-17 14:01:51 +0100 |
commit | 9fd4a06fcb563df24689c3e87b8d38e6242c230a (patch) | |
tree | 6b3882e2d2340ee13d177d0b6b47f9abe1d768af /src/rabbit_msg_store.erl | |
parent | b0ac434e4b3f06c555f2b9f737152178b3b7b95d (diff) | |
download | rabbitmq-server-9fd4a06fcb563df24689c3e87b8d38e6242c230a.tar.gz |
Check value when clients update flying_ets
Diffstat (limited to 'src/rabbit_msg_store.erl')
-rw-r--r-- | src/rabbit_msg_store.erl | 5 |
1 files changed, 4 insertions, 1 deletions
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 |