diff options
| author | Matthias Radestock <matthias@lshift.net> | 2009-09-21 08:19:07 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2009-09-21 08:19:07 +0100 |
| commit | e318fdcfd257f5e5700566d7e5de61400c5a848a (patch) | |
| tree | f45d9a23f243fd5657f0c8dccd4ac699ca4df944 /src | |
| parent | a07c9407289e4ae99ae919c36e7dd1afe731632a (diff) | |
| download | rabbitmq-server-git-e318fdcfd257f5e5700566d7e5de61400c5a848a.tar.gz | |
get rid of closing_chpid process dict entries
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_reader.erl | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index 5d7f8a42c7..ec0c70fbc5 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]). |
