summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/rabbitmq.conf.example2
-rw-r--r--src/rabbit_priority_queue.erl4
-rw-r--r--src/rabbit_reader.erl20
3 files changed, 20 insertions, 6 deletions
diff --git a/docs/rabbitmq.conf.example b/docs/rabbitmq.conf.example
index 6e91ebbe77..b7c9214343 100644
--- a/docs/rabbitmq.conf.example
+++ b/docs/rabbitmq.conf.example
@@ -521,7 +521,7 @@
## Related doc guide: http://rabbitmq.com/shovel.html
## ----------------------------------------------------------------------------
-## Shovel plugin config example is defined in additional.config file
+## See advanced.config.example for a Shovel plugin example
## ----------------------------------------------------------------------------
diff --git a/src/rabbit_priority_queue.erl b/src/rabbit_priority_queue.erl
index b1eb83dddc..7b75dd4afd 100644
--- a/src/rabbit_priority_queue.erl
+++ b/src/rabbit_priority_queue.erl
@@ -666,8 +666,8 @@ cse(_, lazy) -> lazy;
cse(lazy, _) -> lazy;
%% numerical stats
cse(A, B) when is_number(A) -> A + B;
-cse({delta, _, _, _, _}, _) -> {delta, todo, todo, todo, todo};
-cse(A, B) -> exit({A, B}).
+cse({delta, _, _, _, _}, _) -> {delta, todo, todo, todo, todo};
+cse(_, _) -> undefined.
%% When asked about 'head_message_timestamp' fro this priority queue, we
%% walk all the backing queues, starting by the highest priority. Once a
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) ->
+ "".