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 | 589c666e89dcffb5bf596f0682339286622869b4 (patch) | |
| tree | 6b3882e2d2340ee13d177d0b6b47f9abe1d768af /src | |
| parent | b390a52c7a576ff79b466ae7b2ffea8c95f306d4 (diff) | |
| download | rabbitmq-server-git-589c666e89dcffb5bf596f0682339286622869b4.tar.gz | |
Check value when clients update flying_ets
Diffstat (limited to 'src')
| -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 c63321b5e5..35c0239f6c 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 |
