summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bakken <luke@bakken.io>2018-08-15 11:23:11 -0700
committerGitHub <noreply@github.com>2018-08-15 11:23:11 -0700
commitc7dea5809f5588ae6b0e91110e52d4007d6f5071 (patch)
tree1c41c2e92f0c7599d9e8d0f5beb29cf4b2e4db8b
parent7747cb45e337115fc74466c5ef5730c156411482 (diff)
parent0302a0c8afbc810e41effd4d532d8c40b24577e0 (diff)
downloadrabbitmq-server-git-c7dea5809f5588ae6b0e91110e52d4007d6f5071.tar.gz
Merge pull request #1673 from rabbitmq/lrb-add-channel_max-detail
Add detail for channel_max 0 value
-rw-r--r--src/rabbit_reader.erl20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 08ebd2745b..83f5ddaccb 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -430,6 +430,13 @@ log_connection_exception(Severity, Name, {connection_closed_abruptly, _}) ->
log_connection_exception_with_severity(Severity,
"closing AMQP connection ~p (~s):~nclient unexpectedly closed TCP connection~n",
[self(), Name]);
+%% failed connection.tune negotiations
+log_connection_exception(Severity, Name, {handshake_error, tuning, _Channel,
+ {exit, #amqp_error{explanation = Explanation},
+ _Method, _Stacktrace}}) ->
+ log_connection_exception_with_severity(Severity,
+ "closing AMQP connection ~p (~s):~nfailed to negotiate connection parameters: ~s~n",
+ [self(), Name, Explanation]);
%% old exception structure
log_connection_exception(Severity, Name, connection_closed_abruptly) ->
log_connection_exception_with_severity(Severity,
@@ -446,7 +453,7 @@ log_connection_exception_with_severity(Severity, Fmt, Args) ->
debug -> rabbit_log_connection:debug(Fmt, Args);
info -> rabbit_log_connection:info(Fmt, Args);
warning -> rabbit_log_connection:warning(Fmt, Args);
- error -> rabbit_log_connection:warning(Fmt, Args)
+ error -> rabbit_log_connection:error(Fmt, Args)
end.
run({M, F, A}) ->
@@ -1298,9 +1305,10 @@ fail_negotiation(Field, MinOrMax, ServerValue, ClientValue) ->
min -> {lower, minimum};
max -> {higher, maximum}
end,
+ ClientValueDetail = get_client_value_detail(Field, ClientValue),
rabbit_misc:protocol_error(
- not_allowed, "negotiated ~w = ~w is ~w than the ~w allowed value (~w)",
- [Field, ClientValue, S1, S2, ServerValue], 'connection.tune').
+ not_allowed, "negotiated ~w = ~w~s is ~w than the ~w allowed value (~w)",
+ [Field, ClientValue, ClientValueDetail, S1, S2, ServerValue], 'connection.tune').
get_env(Key) ->
{ok, Value} = application:get_env(rabbit, Key),
@@ -1722,3 +1730,9 @@ dynamic_connection_name(Default) ->
handle_uncontrolled_channel_close(ChPid) ->
rabbit_core_metrics:channel_closed(ChPid),
rabbit_event:notify(channel_closed, [{pid, ChPid}]).
+
+-spec get_client_value_detail(atom(), integer()) -> string().
+get_client_value_detail(channel_max, 0) ->
+ " (no limit)";
+get_client_value_detail(_Field, _ClientValue) ->
+ "".