diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2018-08-16 19:55:10 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2018-08-16 19:55:10 +0300 |
| commit | 98b1c890af3d76c722341ce9abe1573be99f3533 (patch) | |
| tree | 5d2eb6305509744a3b5239a24ac3358e615fb8e9 /src | |
| parent | f3b99954936897c2d4705bb3b46d6c03ca32983d (diff) | |
| parent | c7dea5809f5588ae6b0e91110e52d4007d6f5071 (diff) | |
| download | rabbitmq-server-git-98b1c890af3d76c722341ce9abe1573be99f3533.tar.gz | |
Merge branch 'master' into topology-recovery
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_priority_queue.erl | 4 | ||||
| -rw-r--r-- | src/rabbit_reader.erl | 20 |
2 files changed, 19 insertions, 5 deletions
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) -> + "". |
