summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2009-09-21 08:19:07 +0100
committerMatthias Radestock <matthias@lshift.net>2009-09-21 08:19:07 +0100
commit5ff2563f1ab5305509bf3be6691ea4493f98e85e (patch)
treef45d9a23f243fd5657f0c8dccd4ac699ca4df944
parentb84783b5d9e607fbc967e5e261f4d89aa03962f0 (diff)
downloadrabbitmq-server-bug21650.tar.gz
get rid of closing_chpid process dict entriesbug21650
They were entirely redundant. It is now the case the the chpid process dict entries only get removed when receiving an EXIT signal from a channel, which is more obviously correct.
-rw-r--r--src/rabbit_reader.erl29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 5d7f8a42..ec0c70fb 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -341,7 +341,6 @@ handle_channel_exit(Channel, Reason, State) ->
handle_dependent_exit(Pid, normal, State) ->
erase({chpid, Pid}),
- erase({closing_chpid, Pid}),
maybe_close(State);
handle_dependent_exit(Pid, Reason, State) ->
case channel_cleanup(Pid) of
@@ -351,17 +350,10 @@ handle_dependent_exit(Pid, Reason, State) ->
channel_cleanup(Pid) ->
case get({chpid, Pid}) of
- undefined ->
- case get({closing_chpid, Pid}) of
- undefined -> undefined;
- {channel, Channel} ->
- erase({closing_chpid, Pid}),
- Channel
- end;
- {channel, Channel} ->
- erase({channel, Channel}),
- erase({chpid, Pid}),
- Channel
+ undefined -> undefined;
+ {channel, Channel} -> erase({channel, Channel}),
+ erase({chpid, Pid}),
+ Channel
end.
all_channels() -> [Pid || {{chpid, Pid},_} <- get()].
@@ -442,7 +434,11 @@ handle_frame(Type, Channel, Payload, State) ->
%%?LOGDEBUG("Ch ~p Frame ~p~n", [Channel, AnalyzedFrame]),
case get({channel, Channel}) of
{chpid, ChPid} ->
- ok = check_for_close(Channel, ChPid, AnalyzedFrame),
+ case AnalyzedFrame of
+ {method, 'channel.close', _} ->
+ erase({channel, Channel});
+ _ -> ok
+ end,
ok = rabbit_framing_channel:process(ChPid, AnalyzedFrame),
State;
closing ->
@@ -713,13 +709,6 @@ send_to_new_channel(Channel, AnalyzedFrame, State) ->
put({chpid, ChPid}, {channel, Channel}),
ok = rabbit_framing_channel:process(ChPid, AnalyzedFrame).
-check_for_close(Channel, ChPid, {method, 'channel.close', _}) ->
- channel_cleanup(ChPid),
- put({closing_chpid, ChPid}, {channel, Channel}),
- ok;
-check_for_close(_Channel, _ChPid, _Frame) ->
- ok.
-
log_channel_error(ConnectionState, Channel, Reason) ->
rabbit_log:error("connection ~p (~p), channel ~p - error:~n~p~n",
[self(), ConnectionState, Channel, Reason]).