diff options
| author | Tim Watson <tim.watson@gmail.com> | 2012-06-18 10:25:10 +0100 |
|---|---|---|
| committer | Tim Watson <tim.watson@gmail.com> | 2012-06-18 10:25:10 +0100 |
| commit | f912360897f1abfc76b17f6dcf52dfb7fca2beba (patch) | |
| tree | d9ac871d0fdd79303decf81ba02e74843f092540 | |
| parent | 138bb19ae3292e32b7286226c49462cae82f7b68 (diff) | |
| download | rabbitmq-server-git-f912360897f1abfc76b17f6dcf52dfb7fca2beba.tar.gz | |
make the error/reason for amqp heartbeat timeouts clearer in the logs
| -rw-r--r-- | src/rabbit_reader.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index c675bc4e71..32b66a7217 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -229,8 +229,8 @@ start_connection(Parent, ChannelSupSupPid, Collector, StartHeartbeatFun, Deb, log(info, "closing AMQP connection ~p (~s)~n", [self(), ConnStr]) catch Ex -> log(case Ex of + {heartbeat_timeout, _} -> warning; connection_closed_abruptly -> warning; - {timeout, _CState} -> amqp_heartbeat_timeout; _ -> error end, "closing AMQP connection ~p (~s):~n~p~n", [self(), ConnStr, Ex]) @@ -314,8 +314,8 @@ handle_other(handshake_timeout, _Deb, State) -> throw({handshake_timeout, State#v1.callback}); handle_other(timeout, Deb, State = #v1{connection_state = closed}) -> mainloop(Deb, State); -handle_other(timeout, _Deb, #v1{connection_state = S}) -> - throw({timeout, S}); +handle_other(heartbeat_timeout, _Deb, #v1{connection_state = S}) -> + throw({heartbeat_timeout, S}); handle_other({'$gen_call', From, {shutdown, Explanation}}, Deb, State) -> {ForceTermination, NewState} = terminate(Explanation, State), gen_server:reply(From, ok), @@ -684,7 +684,7 @@ handle_method0(#'connection.tune_ok'{frame_max = FrameMax, Frame = rabbit_binary_generator:build_heartbeat_frame(), SendFun = fun() -> catch rabbit_net:send(Sock, Frame) end, Parent = self(), - ReceiveFun = fun() -> Parent ! timeout end, + ReceiveFun = fun() -> Parent ! heartbeat_timeout end, Heartbeater = SHF(Sock, ClientHeartbeat, SendFun, ClientHeartbeat, ReceiveFun), State#v1{connection_state = opening, |
