summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-06-29 14:40:25 +0200
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-06-29 14:40:25 +0200
commit1e4ca4672c397e95a5caf945b4d9492c3799cd80 (patch)
treeeca6a802a8043c8aaf630defd59f233871cc8b9a /src
parenta8d622317ea37bbcd3355cadb66d910f97a6f574 (diff)
downloadrabbitmq-server-git-1e4ca4672c397e95a5caf945b4d9492c3799cd80.tar.gz
Ensure the conditions to log "accepting..." match those for "closing..."
For instance, the following test led to "accepting AMQP connection" being logged, but no corresponding "closing AMQP connection": $ nc localhost 5672 a ^C The same issue applied to TLS connections. References bug26427.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_reader.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 1cc12dbd16..94723fbae1 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -350,6 +350,8 @@ mainloop(Deb, Buf, BufLen, State = #v1{sock = Sock,
State#v1{pending_recv = false});
closed when State#v1.connection_state =:= closed ->
ok;
+ closed when CS =:= pre_init andalso Buf =:= [] ->
+ stop(tcp_healthcheck, State);
closed ->
stop(closed, State);
{error, Reason} ->
@@ -364,7 +366,7 @@ mainloop(Deb, Buf, BufLen, State = #v1{sock = Sock,
end
end.
-stop(closed, #v1{connection_state = pre_init} = State) ->
+stop(tcp_healthcheck, State) ->
%% The connection was closed before any packet was received. It's
%% probably a load-balancer healthcheck: don't consider this a
%% failure.