summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-01-13 13:46:27 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2012-01-13 13:46:27 +0000
commit958d9dcb664feb17776905749e6efec889633b34 (patch)
tree076c2580e0d93a607acf442837e5f6279d8fefac
parenta97dac21a8ecd7fa57a001f90a6986b9cd2e5958 (diff)
downloadrabbitmq-server-958d9dcb664feb17776905749e6efec889633b34.tar.gz
unblock, if possible, when channels disappear
We do this in all call sites of channel_cleanup, except in wait_for_channel_termination, since there we know we are about to enter the 'closed' state, which unblocks us anyway.
-rw-r--r--src/rabbit_reader.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index cf6bf6fa..f22b6b94 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -284,7 +284,7 @@ handle_other({conserve_memory, Conserve}, Deb, State) ->
handle_other({channel_closing, ChPid}, Deb, State) ->
ok = rabbit_channel:ready_for_close(ChPid),
channel_cleanup(ChPid),
- mainloop(Deb, maybe_close(State));
+ mainloop(Deb, maybe_close(control_throttle(State)));
handle_other({'EXIT', Parent, Reason}, _Deb, State = #v1{parent = Parent}) ->
terminate(io_lib:format("broker forced connection closure "
"with reason '~w'", [Reason]), State),
@@ -404,11 +404,12 @@ handle_dependent_exit(ChPid, Reason, State) ->
{undefined, uncontrolled} ->
exit({abnormal_dependent_exit, ChPid, Reason});
{_Channel, controlled} ->
- maybe_close(State);
+ maybe_close(control_throttle(State));
{Channel, uncontrolled} ->
rabbit_log:error("connection ~p, channel ~p - error:~n~p~n",
[self(), Channel, Reason]),
- maybe_close(handle_exception(State, Channel, Reason))
+ maybe_close(handle_exception(control_throttle(State),
+ Channel, Reason))
end.
channel_cleanup(ChPid) ->
@@ -523,7 +524,7 @@ handle_frame(Type, Channel, Payload,
post_process_frame({method, 'channel.close_ok', _}, ChPid, State) ->
channel_cleanup(ChPid),
- State;
+ control_throttle(State);
post_process_frame({method, MethodName, _}, _ChPid,
State = #v1{connection = #connection{
protocol = Protocol}}) ->