summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bakken <lbakken@pivotal.io>2018-08-15 07:55:47 -0700
committerLuke Bakken <lbakken@pivotal.io>2018-08-15 07:55:47 -0700
commitd5f2eb68e747bcff01ac14756f85afd86806e641 (patch)
treee7b7fbcdd9dd70cc604b2f33bad91ed5fc3e961d
parent7747cb45e337115fc74466c5ef5730c156411482 (diff)
downloadrabbitmq-server-git-d5f2eb68e747bcff01ac14756f85afd86806e641.tar.gz
Add detail for channel_max 0 value
It is not immediately obvious that a 0 value for channel_max means infinite or "no limit". This change will result in the following message being logged: "negotiated channel_max = 0 (no limit) is higher than the maximum allowed value (2047)"
-rw-r--r--src/rabbit_reader.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 08ebd2745b..4392895fbc 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -1298,9 +1298,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 +1723,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) ->
+ "".