From 5993ddcaa3f59b25a1dfc795aeee96c6b5068103 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Thu, 20 Jun 2013 06:57:18 +0100 Subject: [PATCH] fix channel 0 exit handling --- src/amqp_channel.erl | 2 +- src/amqp_network_connection.erl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/amqp_channel.erl b/src/amqp_channel.erl index 5aa74d2b..5260df06 100644 --- a/src/amqp_channel.erl +++ b/src/amqp_channel.erl @@ -592,7 +592,7 @@ do_rpc(State = #state{rpc_requests = Q, {_, ok} -> gen_server:reply(From, ok); _ -> ok %% Do not reply if error in do. Expecting - %% {channel_exit, ...} + %% {channel_exit, _, _} end, do_rpc(State1#state{rpc_requests = NewQ}) end; diff --git a/src/amqp_network_connection.erl b/src/amqp_network_connection.erl index e5be73b8..214ce19d 100644 --- a/src/amqp_network_connection.erl +++ b/src/amqp_network_connection.erl @@ -52,7 +52,7 @@ do(Method, State) -> do2(Method, State). do2(Method, #state{writer0 = Writer}) -> - %% Catching because it expects the {channel_exit, _} message on error + %% Catching because it expects the {channel_exit, _, _} message on error catch rabbit_writer:send_command_sync(Writer, Method). handle_message(socket_closing_timeout, @@ -65,7 +65,7 @@ handle_message(socket_closed, State = #state{waiting_socket_close = false}) -> {stop, socket_closed_unexpectedly, State}; handle_message({socket_error, _} = SocketError, State) -> {stop, SocketError, State}; -handle_message({channel_exit, Reason}, State) -> +handle_message({channel_exit, 0, Reason}, State) -> {stop, {channel0_died, Reason}, State}; handle_message(heartbeat_timeout, State) -> {stop, heartbeat_timeout, State};