summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-02-11 14:52:32 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2011-02-11 14:52:32 +0000
commit2cd46719d931ae06c5df89a0c1e96c3a32756588 (patch)
tree0c5f7faff87518733d90a1d030b564b33749ce7c
parenteec000ad98d1a4cf1cd0638ab97b20c7c8fead73 (diff)
downloadrabbitmq-server-git-2cd46719d931ae06c5df89a0c1e96c3a32756588.tar.gz
Always erase both channel and ch_pid. This is lovely - it makes it a proper bidirectional mapping. All java tests now pass again.
-rw-r--r--src/rabbit_channel.erl5
-rw-r--r--src/rabbit_reader.erl6
2 files changed, 5 insertions, 6 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 180e9393c2..7d47eecdf8 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -555,9 +555,8 @@ handle_method(#'channel.close'{}, _, State = #ch{state = closing}) ->
handle_method(_Method, _, State = #ch{state = closing}) ->
{noreply, State};
-handle_method(#'channel.close'{}, _, State = #ch{reader_pid = ReaderPid,
- channel = Channel}) ->
- ReaderPid ! {channel_closing, Channel, self()},
+handle_method(#'channel.close'{}, _, State = #ch{reader_pid = ReaderPid}) ->
+ ReaderPid ! {channel_closing, self()},
%% no error, so rollback_and_notify should be 'ok'. Do in parallel
%% with the reader picking up our message and running our Fun.
{ok, State1} = rollback_and_notify(State),
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index f950bb00ed..a8abebd818 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -242,9 +242,9 @@ mainloop(Deb, State = #v1{parent = Parent, sock= Sock, recv_ref = Ref}) ->
throw({inet_error, Reason});
{conserve_memory, Conserve} ->
mainloop(Deb, internal_conserve_memory(Conserve, State));
- {channel_closing, Channel, ChPid} ->
+ {channel_closing, ChPid} ->
ok = rabbit_channel:ready_for_close(ChPid),
- erase({channel, Channel}),
+ channel_cleanup(ChPid),
mainloop(Deb, State);
{'EXIT', Parent, Reason} ->
terminate(io_lib:format("broker forced connection closure "
@@ -467,7 +467,7 @@ handle_frame(Type, Channel, Payload,
put({channel, Channel}, {ChPid, NewAState}),
case AnalyzedFrame of
{method, 'channel.close_ok', _} ->
- erase({channel, Channel}),
+ channel_cleanup(ChPid),
State;
{method, MethodName, _} ->
case (State#v1.connection_state =:= blocking