diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2012-03-22 15:15:56 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-03-22 15:15:56 +0000 |
| commit | 9506c29260675298a13a7bc73567e61c8f1b0b2b (patch) | |
| tree | 616156b73c2e40bc2532cbc766af3d59331c1114 /src | |
| parent | d32586f256e3c1d2e498805d92ed247396397d41 (diff) | |
| download | rabbitmq-server-git-9506c29260675298a13a7bc73567e61c8f1b0b2b.tar.gz | |
fix a possible leak
it's not clear whether we can actually end up in the 'none' branch,
but assuming it exists for a reason, we should certainly clear the
dict entry there too.
We don't actually need to clear the entry in the {value, ...} branch,
since handle_confirm will do that. But clearing in all cases is more
obviously correct.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 106a99607c..bdb6a0b6f1 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -794,9 +794,10 @@ handle_queue_down(QPid, Reason, State = #q{queue_monitors = QMons, {ok, _} -> #resource{name = QName} = qname(State), rabbit_log:info("DLQ ~p (for ~p) died~n", [QPid, QName]), + State1 = State#q{queue_monitors = dict:erase(QPid, QMons)}, case gb_trees:lookup(QPid, UQM) of none -> - noreply(State); + noreply(State1); {value, MsgSeqNosSet} -> case rabbit_misc:is_abnormal_termination(Reason) of true -> rabbit_log:warning( @@ -804,9 +805,7 @@ handle_queue_down(QPid, Reason, State = #q{queue_monitors = QMons, [gb_sets:size(MsgSeqNosSet)]); false -> ok end, - handle_confirm(gb_sets:to_list(MsgSeqNosSet), QPid, - State#q{queue_monitors = - dict:erase(QPid, QMons)}) + handle_confirm(gb_sets:to_list(MsgSeqNosSet), QPid, State1) end end. |
