diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2013-02-15 00:02:15 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2013-02-15 00:02:15 +0000 |
commit | 2532b6c41a1179e745e2f42235040b54de3472fa (patch) | |
tree | a6b75c6fd5a7354d26e1fc68b44b7745782334ba /src | |
parent | 62a56ef145ab4fb8bbfafec0db78734c8cb518a3 (diff) | |
download | rabbitmq-server-2532b6c41a1179e745e2f42235040b54de3472fa.tar.gz |
explain
Diffstat (limited to 'src')
-rw-r--r-- | src/rabbit_channel.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index e74211af..eb03bf54 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -589,6 +589,16 @@ handle_method(_Method, _, State = #ch{state = closing}) -> handle_method(#'channel.close'{}, _, State = #ch{reader_pid = ReaderPid}) -> {ok, State1} = notify_queues(State), + %% We issue the channel.close_ok response after a handshake with + %% the reader, the other half of which is the + %% ready_for_close. That way the reader forgets about the channel + %% before we send the response (and this channel process + %% terminates). If we didn't do that, a channel.open for the same + %% channel number, which a client is entitled to send as soon as + %% it has received the close_ok, might be received by the reader + %% before it has seen the termination and hence be sent to the + %% old, now dead/dying channel process, instead of a new process, + %% and thus lost. ReaderPid ! {channel_closing, self()}, {noreply, State1}; |