Skip to content

Commit 98b1c89

Browse files
Merge branch 'master' into topology-recovery
2 parents f3b9995 + c7dea58 commit 98b1c89

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

docs/rabbitmq.conf.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@
521521
## Related doc guide: http://rabbitmq.com/shovel.html
522522
## ----------------------------------------------------------------------------
523523

524-
## Shovel plugin config example is defined in additional.config file
524+
## See advanced.config.example for a Shovel plugin example
525525

526526

527527
## ----------------------------------------------------------------------------

src/rabbit_priority_queue.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ cse(_, lazy) -> lazy;
666666
cse(lazy, _) -> lazy;
667667
%% numerical stats
668668
cse(A, B) when is_number(A) -> A + B;
669-
cse({delta, _, _, _, _}, _) -> {delta, todo, todo, todo, todo};
670-
cse(A, B) -> exit({A, B}).
669+
cse({delta, _, _, _, _}, _) -> {delta, todo, todo, todo, todo};
670+
cse(_, _) -> undefined.
671671

672672
%% When asked about 'head_message_timestamp' fro this priority queue, we
673673
%% walk all the backing queues, starting by the highest priority. Once a

src/rabbit_reader.erl

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,13 @@ log_connection_exception(Severity, Name, {connection_closed_abruptly, _}) ->
430430
log_connection_exception_with_severity(Severity,
431431
"closing AMQP connection ~p (~s):~nclient unexpectedly closed TCP connection~n",
432432
[self(), Name]);
433+
%% failed connection.tune negotiations
434+
log_connection_exception(Severity, Name, {handshake_error, tuning, _Channel,
435+
{exit, #amqp_error{explanation = Explanation},
436+
_Method, _Stacktrace}}) ->
437+
log_connection_exception_with_severity(Severity,
438+
"closing AMQP connection ~p (~s):~nfailed to negotiate connection parameters: ~s~n",
439+
[self(), Name, Explanation]);
433440
%% old exception structure
434441
log_connection_exception(Severity, Name, connection_closed_abruptly) ->
435442
log_connection_exception_with_severity(Severity,
@@ -446,7 +453,7 @@ log_connection_exception_with_severity(Severity, Fmt, Args) ->
446453
debug -> rabbit_log_connection:debug(Fmt, Args);
447454
info -> rabbit_log_connection:info(Fmt, Args);
448455
warning -> rabbit_log_connection:warning(Fmt, Args);
449-
error -> rabbit_log_connection:warning(Fmt, Args)
456+
error -> rabbit_log_connection:error(Fmt, Args)
450457
end.
451458

452459
run({M, F, A}) ->
@@ -1298,9 +1305,10 @@ fail_negotiation(Field, MinOrMax, ServerValue, ClientValue) ->
12981305
min -> {lower, minimum};
12991306
max -> {higher, maximum}
13001307
end,
1308+
ClientValueDetail = get_client_value_detail(Field, ClientValue),
13011309
rabbit_misc:protocol_error(
1302-
not_allowed, "negotiated ~w = ~w is ~w than the ~w allowed value (~w)",
1303-
[Field, ClientValue, S1, S2, ServerValue], 'connection.tune').
1310+
not_allowed, "negotiated ~w = ~w~s is ~w than the ~w allowed value (~w)",
1311+
[Field, ClientValue, ClientValueDetail, S1, S2, ServerValue], 'connection.tune').
13041312

13051313
get_env(Key) ->
13061314
{ok, Value} = application:get_env(rabbit, Key),
@@ -1722,3 +1730,9 @@ dynamic_connection_name(Default) ->
17221730
handle_uncontrolled_channel_close(ChPid) ->
17231731
rabbit_core_metrics:channel_closed(ChPid),
17241732
rabbit_event:notify(channel_closed, [{pid, ChPid}]).
1733+
1734+
-spec get_client_value_detail(atom(), integer()) -> string().
1735+
get_client_value_detail(channel_max, 0) ->
1736+
" (no limit)";
1737+
get_client_value_detail(_Field, _ClientValue) ->
1738+
"".

0 commit comments

Comments
 (0)