@@ -429,6 +429,13 @@ log_connection_exception(Severity, Name, {connection_closed_abruptly, _}) ->
429
429
log_connection_exception_with_severity (Severity ,
430
430
" closing AMQP connection ~p (~s ):~n client unexpectedly closed TCP connection~n " ,
431
431
[self (), Name ]);
432
+ % % failed connection.tune negotiations
433
+ log_connection_exception (Severity , Name , {handshake_error , tuning , _Channel ,
434
+ {exit , # amqp_error {explanation = Explanation },
435
+ _Method , _Stacktrace }}) ->
436
+ log_connection_exception_with_severity (Severity ,
437
+ " closing AMQP connection ~p (~s ):~n failed to negotiate connection parameters: ~s~n " ,
438
+ [self (), Name , Explanation ]);
432
439
% % old exception structure
433
440
log_connection_exception (Severity , Name , connection_closed_abruptly ) ->
434
441
log_connection_exception_with_severity (Severity ,
@@ -445,7 +452,7 @@ log_connection_exception_with_severity(Severity, Fmt, Args) ->
445
452
debug -> rabbit_log_connection :debug (Fmt , Args );
446
453
info -> rabbit_log_connection :info (Fmt , Args );
447
454
warning -> rabbit_log_connection :warning (Fmt , Args );
448
- error -> rabbit_log_connection :warning (Fmt , Args )
455
+ error -> rabbit_log_connection :error (Fmt , Args )
449
456
end .
450
457
451
458
run ({M , F , A }) ->
@@ -1297,9 +1304,10 @@ fail_negotiation(Field, MinOrMax, ServerValue, ClientValue) ->
1297
1304
min -> {lower , minimum };
1298
1305
max -> {higher , maximum }
1299
1306
end ,
1307
+ ClientValueDetail = get_client_value_detail (Field , ClientValue ),
1300
1308
rabbit_misc :protocol_error (
1301
- not_allowed , " negotiated ~w = ~w is ~w than the ~w allowed value (~w )" ,
1302
- [Field , ClientValue , S1 , S2 , ServerValue ], 'connection.tune' ).
1309
+ not_allowed , " negotiated ~w = ~w~s is ~w than the ~w allowed value (~w )" ,
1310
+ [Field , ClientValue , ClientValueDetail , S1 , S2 , ServerValue ], 'connection.tune' ).
1303
1311
1304
1312
get_env (Key ) ->
1305
1313
{ok , Value } = application :get_env (rabbit , Key ),
@@ -1721,3 +1729,9 @@ dynamic_connection_name(Default) ->
1721
1729
handle_uncontrolled_channel_close (ChPid ) ->
1722
1730
rabbit_core_metrics :channel_closed (ChPid ),
1723
1731
rabbit_event :notify (channel_closed , [{pid , ChPid }]).
1732
+
1733
+ -spec get_client_value_detail (atom (), integer ()) -> string ().
1734
+ get_client_value_detail (channel_max , 0 ) ->
1735
+ " (no limit)" ;
1736
+ get_client_value_detail (_Field , _ClientValue ) ->
1737
+ " " .
0 commit comments