diff options
author | Emile Joubert <emile@rabbitmq.com> | 2013-06-27 14:02:17 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2013-06-27 14:02:17 +0100 |
commit | 23344f846db43fcedd526f3ce0127fbf4847396e (patch) | |
tree | 6fafaa9e31691485e018a554e70714f4f8973f4d | |
parent | a222f45cb5c56ed51a2f40fa00f99cc5b3b49e90 (diff) | |
download | rabbitmq-server-23344f846db43fcedd526f3ce0127fbf4847396e.tar.gz |
Stem leak when master deals with discarded messages
-rw-r--r-- | src/rabbit_mirror_queue_master.erl | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/rabbit_mirror_queue_master.erl b/src/rabbit_mirror_queue_master.erl index bcd4861a..acf77df6 100644 --- a/src/rabbit_mirror_queue_master.erl +++ b/src/rabbit_mirror_queue_master.erl @@ -229,17 +229,15 @@ discard(MsgId, ChPid, State = #state { gm = GM, %% already been published or published-and-confirmed. To do that %% would require non FIFO access. Hence we should not find %% 'published' or 'confirmed' in this dict:find. - case dict:find(MsgId, SS) of - error -> - ok = gm:broadcast(GM, {discard, ChPid, MsgId}), - BQS1 = BQ:discard(MsgId, ChPid, BQS), - ensure_monitoring( - ChPid, State #state { - backing_queue_state = BQS1, - seen_status = dict:erase(MsgId, SS) }); - {ok, discarded} -> - State - end. + State1 = case dict:find(MsgId, SS) of + error -> + ok = gm:broadcast(GM, {discard, ChPid, MsgId}), + State #state { backing_queue_state = + BQ:discard(MsgId, ChPid, BQS) }; + {ok, discarded} -> + State #state { seen_status = dict:erase(MsgId, SS) } + end, + ensure_monitoring(ChPid, State1). dropwhile(Pred, State = #state{backing_queue = BQ, backing_queue_state = BQS }) -> |