diff --git a/deps/amqp_client/src/amqp_direct_connection.erl b/deps/amqp_client/src/amqp_direct_connection.erl index 54d69aed51..2c408e4f0e 100644 --- a/deps/amqp_client/src/amqp_direct_connection.erl +++ b/deps/amqp_client/src/amqp_direct_connection.erl @@ -78,6 +78,8 @@ handle_message({'DOWN', _MRef, process, _ConnSup, shutdown}, State) -> {stop, {shutdown, node_down}, State}; handle_message({'DOWN', _MRef, process, _ConnSup, Reason}, State) -> {stop, {remote_node_down, Reason}, State}; +handle_message({'EXIT', Pid, Reason}, State) -> + {stop, rabbit_misc:format("stopping because dependent process ~p died: ~p", [Pid, Reason]), State}; handle_message(Msg, State) -> {stop, {unexpected_msg, Msg}, State}. diff --git a/deps/amqp_client/src/amqp_gen_connection.erl b/deps/amqp_client/src/amqp_gen_connection.erl index 29099030ca..9af6d770f9 100644 --- a/deps/amqp_client/src/amqp_gen_connection.erl +++ b/deps/amqp_client/src/amqp_gen_connection.erl @@ -230,8 +230,9 @@ handle_info({'EXIT', BlockHandler, Reason}, "Reason: ~p~n", [self(), BlockHandler, Reason]), erlang:demonitor(Ref, [flush]), {noreply, State#state{block_handler = none}}; -handle_info({'EXIT', _Pid, _Reason}, State) -> - {noreply, State}; +%% propagate the exit to the module that will stop with a sensible reason logged +handle_info({'EXIT', _Pid, _Reason} = Info, State) -> + callback(handle_message, [Info], State); handle_info(Info, State) -> callback(handle_message, [Info], State). diff --git a/deps/amqp_client/src/amqp_network_connection.erl b/deps/amqp_client/src/amqp_network_connection.erl index cd3c7061ab..fe853864ff 100644 --- a/deps/amqp_client/src/amqp_network_connection.erl +++ b/deps/amqp_client/src/amqp_network_connection.erl @@ -73,6 +73,8 @@ handle_message(heartbeat_timeout, State) -> {stop, heartbeat_timeout, State}; handle_message(closing_timeout, State = #state{closing_reason = Reason}) -> {stop, Reason, State}; +handle_message({'EXIT', Pid, Reason}, State) -> + {stop, rabbit_misc:format("stopping because dependent process ~p died: ~p", [Pid, Reason]), State}; %% see http://erlang.org/pipermail/erlang-bugs/2012-June/002933.html handle_message({Ref, {error, Reason}}, State = #state{waiting_socket_close = Waiting,