@@ -430,6 +430,13 @@ log_connection_exception(Severity, Name, {connection_closed_abruptly, _}) ->
430
430
log_connection_exception_with_severity (Severity ,
431
431
" closing AMQP connection ~p (~s ):~n client unexpectedly closed TCP connection~n " ,
432
432
[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 ):~n failed to negotiate connection parameters: ~s~n " ,
439
+ [self (), Name , Explanation ]);
433
440
% % old exception structure
434
441
log_connection_exception (Severity , Name , connection_closed_abruptly ) ->
435
442
log_connection_exception_with_severity (Severity ,
@@ -446,7 +453,7 @@ log_connection_exception_with_severity(Severity, Fmt, Args) ->
446
453
debug -> rabbit_log_connection :debug (Fmt , Args );
447
454
info -> rabbit_log_connection :info (Fmt , Args );
448
455
warning -> rabbit_log_connection :warning (Fmt , Args );
449
- error -> rabbit_log_connection :warning (Fmt , Args )
456
+ error -> rabbit_log_connection :error (Fmt , Args )
450
457
end .
451
458
452
459
run ({M , F , A }) ->
@@ -1298,9 +1305,10 @@ fail_negotiation(Field, MinOrMax, ServerValue, ClientValue) ->
1298
1305
min -> {lower , minimum };
1299
1306
max -> {higher , maximum }
1300
1307
end ,
1308
+ ClientValueDetail = get_client_value_detail (Field , ClientValue ),
1301
1309
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' ).
1304
1312
1305
1313
get_env (Key ) ->
1306
1314
{ok , Value } = application :get_env (rabbit , Key ),
@@ -1722,3 +1730,9 @@ dynamic_connection_name(Default) ->
1722
1730
handle_uncontrolled_channel_close (ChPid ) ->
1723
1731
rabbit_core_metrics :channel_closed (ChPid ),
1724
1732
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