Trigger CI
Peer Discovery AWS Integration Test / Integration Test (push) Waiting to run
Details
Peer Discovery AWS Integration Test / Integration Test (push) Waiting to run
Details
This commit is contained in:
parent
4f3f4b085d
commit
02df90c490
|
@ -158,7 +158,7 @@ handle_event(info, {TcpError, _Sock, Reason}, StateName, State)
|
|||
handle_event(info, {TcpClosed, _}, StateName, State)
|
||||
when TcpClosed == tcp_closed orelse TcpClosed == ssl_closed ->
|
||||
?LOG_INFO("AMQP 1.0 connection socket was closed, connection state: '~ts'",
|
||||
[StateName]),
|
||||
[StateName]),
|
||||
{stop, normal, socket_closed(State)};
|
||||
handle_event(info, {gun_down, WsPid, _Proto, Reason, _Streams}, StateName,
|
||||
#state{socket = {ws, WsPid, _StreamRef}} = State) ->
|
||||
|
|
|
@ -516,7 +516,7 @@ handle_info({bump_credit, Msg}, State) ->
|
|||
%% @private
|
||||
handle_info(timed_out_flushing_channel, State) ->
|
||||
?LOG_WARNING("Channel (~tp) closing: timed out flushing while "
|
||||
"connection closing", [self()]),
|
||||
"connection closing", [self()]),
|
||||
{stop, timed_out_flushing_channel, State};
|
||||
%% @private
|
||||
handle_info({'DOWN', _, process, ReturnHandler, shutdown},
|
||||
|
@ -525,7 +525,7 @@ handle_info({'DOWN', _, process, ReturnHandler, shutdown},
|
|||
handle_info({'DOWN', _, process, ReturnHandler, Reason},
|
||||
State = #state{return_handler = {ReturnHandler, _Ref}}) ->
|
||||
?LOG_WARNING("Channel (~tp): Unregistering return handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), ReturnHandler, Reason]),
|
||||
"Reason: ~tp", [self(), ReturnHandler, Reason]),
|
||||
{noreply, State#state{return_handler = none}};
|
||||
%% @private
|
||||
handle_info({'DOWN', _, process, ConfirmHandler, shutdown},
|
||||
|
@ -534,7 +534,7 @@ handle_info({'DOWN', _, process, ConfirmHandler, shutdown},
|
|||
handle_info({'DOWN', _, process, ConfirmHandler, Reason},
|
||||
State = #state{confirm_handler = {ConfirmHandler, _Ref}}) ->
|
||||
?LOG_WARNING("Channel (~tp): Unregistering confirm handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), ConfirmHandler, Reason]),
|
||||
"Reason: ~tp", [self(), ConfirmHandler, Reason]),
|
||||
{noreply, State#state{confirm_handler = none}};
|
||||
%% @private
|
||||
handle_info({'DOWN', _, process, FlowHandler, shutdown},
|
||||
|
@ -543,7 +543,7 @@ handle_info({'DOWN', _, process, FlowHandler, shutdown},
|
|||
handle_info({'DOWN', _, process, FlowHandler, Reason},
|
||||
State = #state{flow_handler = {FlowHandler, _Ref}}) ->
|
||||
?LOG_WARNING("Channel (~tp): Unregistering flow handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), FlowHandler, Reason]),
|
||||
"Reason: ~tp", [self(), FlowHandler, Reason]),
|
||||
{noreply, State#state{flow_handler = none}};
|
||||
handle_info({'DOWN', _, process, QPid, _Reason}, State) ->
|
||||
rabbit_amqqueue_common:notify_sent_queue_down(QPid),
|
||||
|
@ -593,13 +593,13 @@ handle_method_to_server(Method, AmqpMsg, From, Sender, Flow,
|
|||
From, Sender, Flow, State1)};
|
||||
{ok, none, BlockReply} ->
|
||||
?LOG_WARNING("Channel (~tp): discarding method ~tp in cast.~n"
|
||||
"Reason: ~tp", [self(), Method, BlockReply]),
|
||||
"Reason: ~tp", [self(), Method, BlockReply]),
|
||||
{noreply, State};
|
||||
{ok, _, BlockReply} ->
|
||||
{reply, BlockReply, State};
|
||||
{{_, InvalidMethodMessage}, none, _} ->
|
||||
?LOG_WARNING("Channel (~tp): ignoring cast of ~tp method. " ++
|
||||
InvalidMethodMessage ++ "", [self(), Method]),
|
||||
InvalidMethodMessage ++ "", [self(), Method]),
|
||||
{noreply, State};
|
||||
{{InvalidMethodReply, _}, _, _} ->
|
||||
{reply, {error, InvalidMethodReply}, State}
|
||||
|
@ -796,7 +796,7 @@ handle_method_from_server1(#'basic.ack'{} = BasicAck, none,
|
|||
handle_method_from_server1(#'basic.nack'{} = BasicNack, none,
|
||||
#state{confirm_handler = none} = State) ->
|
||||
?LOG_WARNING("Channel (~tp): received ~tp but there is no "
|
||||
"confirm handler registered", [self(), BasicNack]),
|
||||
"confirm handler registered", [self(), BasicNack]),
|
||||
{noreply, update_confirm_set(BasicNack, State)};
|
||||
handle_method_from_server1(#'basic.nack'{} = BasicNack, none,
|
||||
#state{confirm_handler = {CH, _Ref}} = State) ->
|
||||
|
@ -932,7 +932,7 @@ server_misbehaved(#amqp_error{} = AmqpError, State = #state{number = Number}) ->
|
|||
handle_shutdown({server_misbehaved, AmqpError}, State);
|
||||
{_, Close} ->
|
||||
?LOG_WARNING("Channel (~tp) flushing and closing due to soft "
|
||||
"error caused by the server ~tp", [self(), AmqpError]),
|
||||
"error caused by the server ~tp", [self(), AmqpError]),
|
||||
Self = self(),
|
||||
spawn(fun () -> call(Self, Close) end),
|
||||
{noreply, State}
|
||||
|
|
|
@ -429,7 +429,7 @@ maybe_update_call_timeout(BaseTimeout, CallTimeout)
|
|||
maybe_update_call_timeout(BaseTimeout, CallTimeout) ->
|
||||
EffectiveSafeCallTimeout = amqp_util:safe_call_timeout(BaseTimeout),
|
||||
?LOG_WARNING("AMQP 0-9-1 client call timeout was ~tp ms, is updated to a safe effective "
|
||||
"value of ~tp ms", [CallTimeout, EffectiveSafeCallTimeout]),
|
||||
"value of ~tp ms", [CallTimeout, EffectiveSafeCallTimeout]),
|
||||
amqp_util:update_call_timeout(EffectiveSafeCallTimeout),
|
||||
ok.
|
||||
|
||||
|
|
|
@ -207,12 +207,12 @@ handle_cast({register_blocked_handler, HandlerPid}, State) ->
|
|||
handle_info({'DOWN', _, process, BlockHandler, Reason},
|
||||
State = #state{block_handler = {BlockHandler, _Ref}}) ->
|
||||
?LOG_WARNING("Connection (~tp): Unregistering connection.{blocked,unblocked} handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), BlockHandler, Reason]),
|
||||
"Reason: ~tp", [self(), BlockHandler, Reason]),
|
||||
{noreply, State#state{block_handler = none}};
|
||||
handle_info({'EXIT', BlockHandler, Reason},
|
||||
State = #state{block_handler = {BlockHandler, Ref}}) ->
|
||||
?LOG_WARNING("Connection (~tp): Unregistering connection.{blocked,unblocked} handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), BlockHandler, Reason]),
|
||||
"Reason: ~tp", [self(), BlockHandler, Reason]),
|
||||
erlang:demonitor(Ref, [flush]),
|
||||
{noreply, State#state{block_handler = none}};
|
||||
%% propagate the exit to the module that will stop with a sensible reason logged
|
||||
|
@ -318,7 +318,7 @@ internal_error(Pid, Reason, State) ->
|
|||
|
||||
server_initiated_close(Close, State) ->
|
||||
?LOG_WARNING("Connection (~tp) closing: received hard error ~tp "
|
||||
"from server", [self(), Close]),
|
||||
"from server", [self(), Close]),
|
||||
set_closing_state(abrupt, #closing{reason = server_initiated_close,
|
||||
close = Close}, State).
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ maybe_add_verify1(Options) ->
|
|||
Options;
|
||||
_ ->
|
||||
?LOG_WARNING("Connection (~tp): certificate chain verification is not enabled for this TLS connection. "
|
||||
"Please see https://rabbitmq.com/ssl.html for more information.", [self()]),
|
||||
"Please see https://rabbitmq.com/ssl.html for more information.", [self()]),
|
||||
Options
|
||||
end.
|
||||
|
||||
|
|
|
@ -288,15 +288,15 @@ handle_call({start_child, ChildSpec}, _From,
|
|||
Result = case maybe_start(Group, Overall, Delegate, ChildSpec) of
|
||||
already_in_store ->
|
||||
?LOG_DEBUG("Mirrored supervisor: maybe_start for group ~tp,"
|
||||
" overall ~p returned 'record already present'", [Group, Overall]),
|
||||
" overall ~p returned 'record already present'", [Group, Overall]),
|
||||
{error, already_present};
|
||||
{already_in_store, Pid} ->
|
||||
?LOG_DEBUG("Mirrored supervisor: maybe_start for group ~tp,"
|
||||
" overall ~p returned 'already running: ~tp'", [Group, Overall, Pid]),
|
||||
" overall ~p returned 'already running: ~tp'", [Group, Overall, Pid]),
|
||||
{error, {already_started, Pid}};
|
||||
Else ->
|
||||
?LOG_DEBUG("Mirrored supervisor: maybe_start for group ~tp,"
|
||||
" overall ~tp returned ~tp", [Group, Overall, Else]),
|
||||
" overall ~tp returned ~tp", [Group, Overall, Else]),
|
||||
Else
|
||||
end,
|
||||
mirrored_supervisor_locks:unlock(LockId),
|
||||
|
@ -384,16 +384,16 @@ maybe_start(Group, Overall, Delegate, ChildSpec) ->
|
|||
try check_start(Group, Overall, Delegate, ChildSpec) of
|
||||
start ->
|
||||
?LOG_DEBUG("Mirrored supervisor: check_start for group ~tp,"
|
||||
" overall ~tp returned 'do start'", [Group, Overall]),
|
||||
" overall ~tp returned 'do start'", [Group, Overall]),
|
||||
start(Delegate, ChildSpec);
|
||||
undefined ->
|
||||
?LOG_DEBUG("Mirrored supervisor: check_start for group ~tp,"
|
||||
" overall ~tp returned 'undefined'", [Group, Overall]),
|
||||
" overall ~tp returned 'undefined'", [Group, Overall]),
|
||||
already_in_store;
|
||||
Pid ->
|
||||
?LOG_DEBUG("Mirrored supervisor: check_start for group ~tp,"
|
||||
" overall ~tp returned 'already running (~tp)'",
|
||||
[Group, Overall, Pid]),
|
||||
" overall ~tp returned 'already running (~tp)'",
|
||||
[Group, Overall, Pid]),
|
||||
{already_in_store, Pid}
|
||||
catch
|
||||
%% If we are torn down while in the transaction...
|
||||
|
@ -403,7 +403,7 @@ maybe_start(Group, Overall, Delegate, ChildSpec) ->
|
|||
check_start(Group, Overall, Delegate, ChildSpec) ->
|
||||
Id = id(ChildSpec),
|
||||
?LOG_DEBUG("Mirrored supervisor: check_start for group ~tp, id: ~tp, "
|
||||
"overall: ~tp", [Group, Id, Overall]),
|
||||
"overall: ~tp", [Group, Id, Overall]),
|
||||
case rabbit_db_msup:create_or_update(Group, Overall, Delegate, ChildSpec, Id) of
|
||||
Delegate0 when is_pid(Delegate0) ->
|
||||
child(Delegate0, Id);
|
||||
|
|
|
@ -358,8 +358,7 @@ run_prelaunch_second_phase() ->
|
|||
case IsInitialPass of
|
||||
true ->
|
||||
?LOG_DEBUG(""),
|
||||
?LOG_DEBUG(
|
||||
"== Prelaunch phase [2/2] (initial pass) ==");
|
||||
?LOG_DEBUG("== Prelaunch phase [2/2] (initial pass) ==");
|
||||
false ->
|
||||
?LOG_DEBUG(""),
|
||||
?LOG_DEBUG("== Prelaunch phase [2/2] =="),
|
||||
|
@ -522,10 +521,9 @@ stop_and_halt() ->
|
|||
try
|
||||
stop()
|
||||
catch Type:Reason ->
|
||||
?LOG_ERROR(
|
||||
"Error trying to stop ~ts: ~tp:~tp",
|
||||
[product_name(), Type, Reason],
|
||||
#{domain => ?RMQLOG_DOMAIN_PRELAUNCH}),
|
||||
?LOG_ERROR("Error trying to stop ~ts: ~tp:~tp",
|
||||
[product_name(), Type, Reason],
|
||||
#{domain => ?RMQLOG_DOMAIN_PRELAUNCH}),
|
||||
error({Type, Reason})
|
||||
after
|
||||
%% Enclose all the logging in the try block.
|
||||
|
@ -896,9 +894,8 @@ environment(App) ->
|
|||
-spec rotate_logs() -> rabbit_types:ok_or_error(any()).
|
||||
|
||||
rotate_logs() ->
|
||||
?LOG_ERROR(
|
||||
"Forcing log rotation is currently unsupported",
|
||||
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
|
||||
?LOG_ERROR("Forcing log rotation is currently unsupported",
|
||||
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
|
||||
{error, unsupported}.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
|
@ -1179,7 +1176,7 @@ prevent_startup_if_node_was_reset() ->
|
|||
true ->
|
||||
?LOG_ERROR("Node has already been initialized, but database appears empty. "
|
||||
"This could indicate data loss or a split-brain scenario.",
|
||||
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
|
||||
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
|
||||
throw({error, cluster_already_initialized_but_tables_empty});
|
||||
false ->
|
||||
?LOG_INFO("Node has already been initialized, proceeding with normal startup",
|
||||
|
@ -1189,7 +1186,7 @@ prevent_startup_if_node_was_reset() ->
|
|||
false ->
|
||||
%% First time starting, create the marker file
|
||||
?LOG_INFO("First node startup detected, creating initialization marker",
|
||||
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
|
||||
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
|
||||
ok = filelib:ensure_dir(MarkerFile),
|
||||
ok = file:write_file(MarkerFile, <<>>, [exclusive]), % Empty file.
|
||||
ok
|
||||
|
@ -1689,7 +1686,7 @@ maybe_warn_low_fd_limit() ->
|
|||
ok;
|
||||
L ->
|
||||
?LOG_WARNING("Available file handles: ~tp. "
|
||||
"Please consider increasing system limits", [L])
|
||||
"Please consider increasing system limits", [L])
|
||||
end.
|
||||
|
||||
%% Any configuration that
|
||||
|
|
|
@ -75,7 +75,7 @@ check_user_login(Username, AuthProps, Modules) ->
|
|||
Type:Error:Stacktrace ->
|
||||
?LOG_DEBUG("User '~ts' authentication failed with ~ts:~tp:~n~tp", [Username, Type, Error, Stacktrace]),
|
||||
{refused, Username, "User '~ts' authentication failed with internal error. "
|
||||
"Enable debug logs to see the real error.", [Username]}
|
||||
"Enable debug logs to see the real error.", [Username]}
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
@ -535,11 +535,11 @@ maybe_migrate(ByNode, MaxQueuesDesired, [N | Nodes]) ->
|
|||
end;
|
||||
[{_, _, true} | _] = All when length(All) > MaxQueuesDesired ->
|
||||
?LOG_WARNING("Node ~tp contains ~tp queues, but all have already migrated. "
|
||||
"Do nothing", [N, length(All)]),
|
||||
"Do nothing", [N, length(All)]),
|
||||
maybe_migrate(ByNode, MaxQueuesDesired, Nodes);
|
||||
All ->
|
||||
?LOG_DEBUG("Node ~tp only contains ~tp queues, do nothing",
|
||||
[N, length(All)]),
|
||||
[N, length(All)]),
|
||||
maybe_migrate(ByNode, MaxQueuesDesired, Nodes)
|
||||
end.
|
||||
|
||||
|
@ -1895,7 +1895,8 @@ internal_delete(Queue, ActingUser, Reason) ->
|
|||
%% TODO this is used by `rabbit_mnesia:remove_node_if_mnesia_running`
|
||||
%% Does it make any sense once mnesia is not used/removed?
|
||||
forget_all_durable(Node) ->
|
||||
?LOG_INFO("Will remove all classic queues from node ~ts. The node is likely being removed from the cluster.", [Node]),
|
||||
?LOG_INFO("Will remove all classic queues from node ~ts. The node is likely being removed from the cluster.",
|
||||
[Node]),
|
||||
UpdateFun = fun(Q) ->
|
||||
forget_node_for_queue(Q)
|
||||
end,
|
||||
|
@ -1961,9 +1962,9 @@ on_node_down(Node) ->
|
|||
%% restarts - a time that the cluster is very likely to have a
|
||||
%% majority - to ensure these records are deleted.
|
||||
?LOG_WARNING("transient queues for node '~ts' could not be "
|
||||
"deleted because of a timeout. These queues "
|
||||
"will be removed when node '~ts' restarts or "
|
||||
"is removed from the cluster.", [Node, Node]),
|
||||
"deleted because of a timeout. These queues "
|
||||
"will be removed when node '~ts' restarts or "
|
||||
"is removed from the cluster.", [Node, Node]),
|
||||
ok
|
||||
end.
|
||||
|
||||
|
|
|
@ -472,8 +472,8 @@ notify_user_tags_set(Username, ConvertedTags, ActingUser) ->
|
|||
|
||||
set_permissions(Username, VirtualHost, ConfigurePerm, WritePerm, ReadPerm, ActingUser) ->
|
||||
?LOG_DEBUG("Asked to set permissions for user "
|
||||
"'~ts' in virtual host '~ts' to '~ts', '~ts', '~ts'",
|
||||
[Username, VirtualHost, ConfigurePerm, WritePerm, ReadPerm]),
|
||||
"'~ts' in virtual host '~ts' to '~ts', '~ts', '~ts'",
|
||||
[Username, VirtualHost, ConfigurePerm, WritePerm, ReadPerm]),
|
||||
_ = lists:map(
|
||||
fun (RegexpBin) ->
|
||||
Regexp = binary_to_list(RegexpBin),
|
||||
|
@ -481,8 +481,8 @@ set_permissions(Username, VirtualHost, ConfigurePerm, WritePerm, ReadPerm, Actin
|
|||
{ok, _} -> ok;
|
||||
{error, Reason} ->
|
||||
?LOG_WARNING("Failed to set permissions for user '~ts' in virtual host '~ts': "
|
||||
"regular expression '~ts' is invalid",
|
||||
[Username, VirtualHost, RegexpBin]),
|
||||
"regular expression '~ts' is invalid",
|
||||
[Username, VirtualHost, RegexpBin]),
|
||||
throw({error, {invalid_regexp, Regexp, Reason}})
|
||||
end
|
||||
end, [ConfigurePerm, WritePerm, ReadPerm]),
|
||||
|
@ -497,8 +497,8 @@ set_permissions(Username, VirtualHost, ConfigurePerm, WritePerm, ReadPerm, Actin
|
|||
read = ReadPerm}},
|
||||
R = rabbit_db_user:set_user_permissions(UserPermission),
|
||||
?LOG_INFO("Successfully set permissions for user "
|
||||
"'~ts' in virtual host '~ts' to '~ts', '~ts', '~ts'",
|
||||
[Username, VirtualHost, ConfigurePerm, WritePerm, ReadPerm]),
|
||||
"'~ts' in virtual host '~ts' to '~ts', '~ts', '~ts'",
|
||||
[Username, VirtualHost, ConfigurePerm, WritePerm, ReadPerm]),
|
||||
rabbit_event:notify(permission_created, [{user, Username},
|
||||
{vhost, VirtualHost},
|
||||
{configure, ConfigurePerm},
|
||||
|
@ -579,8 +579,8 @@ set_permissions_globally(Username, ConfigurePerm, WritePerm, ReadPerm, ActingUse
|
|||
|
||||
set_topic_permissions(Username, VirtualHost, Exchange, WritePerm, ReadPerm, ActingUser) ->
|
||||
?LOG_DEBUG("Asked to set topic permissions on exchange '~ts' for "
|
||||
"user '~ts' in virtual host '~ts' to '~ts', '~ts'",
|
||||
[Exchange, Username, VirtualHost, WritePerm, ReadPerm]),
|
||||
"user '~ts' in virtual host '~ts' to '~ts', '~ts'",
|
||||
[Exchange, Username, VirtualHost, WritePerm, ReadPerm]),
|
||||
WritePermRegex = rabbit_data_coercion:to_binary(WritePerm),
|
||||
ReadPermRegex = rabbit_data_coercion:to_binary(ReadPerm),
|
||||
lists:foreach(
|
||||
|
@ -589,8 +589,8 @@ set_topic_permissions(Username, VirtualHost, Exchange, WritePerm, ReadPerm, Acti
|
|||
{ok, _} -> ok;
|
||||
{error, Reason} ->
|
||||
?LOG_WARNING("Failed to set topic permissions on exchange '~ts' for user "
|
||||
"'~ts' in virtual host '~ts': regular expression '~ts' is invalid",
|
||||
[Exchange, Username, VirtualHost, RegexpBin]),
|
||||
"'~ts' in virtual host '~ts': regular expression '~ts' is invalid",
|
||||
[Exchange, Username, VirtualHost, RegexpBin]),
|
||||
throw({error, {invalid_regexp, RegexpBin, Reason}})
|
||||
end
|
||||
end, [WritePerm, ReadPerm]),
|
||||
|
@ -609,8 +609,8 @@ set_topic_permissions(Username, VirtualHost, Exchange, WritePerm, ReadPerm, Acti
|
|||
},
|
||||
R = rabbit_db_user:set_topic_permissions(TopicPermission),
|
||||
?LOG_INFO("Successfully set topic permissions on exchange '~ts' for "
|
||||
"user '~ts' in virtual host '~ts' to '~ts', '~ts'",
|
||||
[Exchange, Username, VirtualHost, WritePerm, ReadPerm]),
|
||||
"user '~ts' in virtual host '~ts' to '~ts', '~ts'",
|
||||
[Exchange, Username, VirtualHost, WritePerm, ReadPerm]),
|
||||
rabbit_event:notify(topic_permission_created, [
|
||||
{user, Username},
|
||||
{vhost, VirtualHost},
|
||||
|
|
|
@ -195,7 +195,7 @@ node_down(Node, _State) ->
|
|||
%% we go back to a not healing state so the node is able to recover.
|
||||
process_down({'EXIT', Pid, Reason}, {restarting, Pid}) when Reason =/= normal ->
|
||||
?LOG_INFO("Autoheal: aborting - the process responsible for restarting the "
|
||||
"node terminated with reason: ~tp", [Reason]),
|
||||
"node terminated with reason: ~tp", [Reason]),
|
||||
not_healing;
|
||||
|
||||
process_down(_, State) ->
|
||||
|
@ -215,10 +215,10 @@ handle_msg({request_start, Node},
|
|||
{ok, AllPartitions} ->
|
||||
{Winner, Losers} = make_decision(AllPartitions),
|
||||
?LOG_INFO("Autoheal decision~n"
|
||||
" * Partitions: ~tp~n"
|
||||
" * Winner: ~tp~n"
|
||||
" * Losers: ~tp",
|
||||
[AllPartitions, Winner, Losers]),
|
||||
" * Partitions: ~tp~n"
|
||||
" * Winner: ~tp~n"
|
||||
" * Losers: ~tp",
|
||||
[AllPartitions, Winner, Losers]),
|
||||
case node() =:= Winner of
|
||||
true -> handle_msg({become_winner, Losers},
|
||||
not_healing, Partitions);
|
||||
|
@ -230,7 +230,7 @@ handle_msg({request_start, Node},
|
|||
handle_msg({request_start, Node},
|
||||
State, _Partitions) ->
|
||||
?LOG_INFO("Autoheal request received from ~tp when healing; "
|
||||
"ignoring", [Node]),
|
||||
"ignoring", [Node]),
|
||||
State;
|
||||
|
||||
handle_msg({become_winner, Losers},
|
||||
|
@ -244,7 +244,7 @@ handle_msg({become_winner, Losers},
|
|||
%% The leader has aborted the healing, might have seen us down but
|
||||
%% we didn't see the same. Let's try again as it is the same partition.
|
||||
?LOG_INFO("Autoheal: I am the winner and received a duplicated "
|
||||
"request, waiting again for ~tp to stop", [Losers]),
|
||||
"request, waiting again for ~tp to stop", [Losers]),
|
||||
stop_partition(Losers);
|
||||
|
||||
handle_msg({become_winner, _},
|
||||
|
@ -252,7 +252,7 @@ handle_msg({become_winner, _},
|
|||
%% Something has happened to the leader, it might have seen us down but we
|
||||
%% are still alive. Partitions have changed, cannot continue.
|
||||
?LOG_INFO("Autoheal: I am the winner and received another healing "
|
||||
"request, partitions have changed to ~tp. Aborting ", [Losers]),
|
||||
"request, partitions have changed to ~tp. Aborting ", [Losers]),
|
||||
winner_finish(Losers),
|
||||
not_healing;
|
||||
|
||||
|
@ -276,7 +276,7 @@ handle_msg({winner_is, Winner}, State = {winner_waiting, _OutstandingStops, _Not
|
|||
handle_msg(Request, {restarting, Pid} = St, _Partitions) ->
|
||||
%% ignore, we can contribute no further
|
||||
?LOG_INFO("Autoheal: Received the request ~tp while waiting for ~tp "
|
||||
"to restart the node. Ignoring it ", [Request, Pid]),
|
||||
"to restart the node. Ignoring it ", [Request, Pid]),
|
||||
St;
|
||||
|
||||
handle_msg(report_autoheal_status, not_healing, _Partitions) ->
|
||||
|
@ -313,7 +313,7 @@ handle_msg({autoheal_finished, Winner}, not_healing, _Partitions) ->
|
|||
%% transitioned to not_healing. However, the winner was still able
|
||||
%% to finish. Let it pass.
|
||||
?LOG_INFO("Autoheal finished according to winner ~tp."
|
||||
" Unexpected, I might have previously seen the winner down", [Winner]),
|
||||
" Unexpected, I might have previously seen the winner down", [Winner]),
|
||||
not_healing.
|
||||
|
||||
%%----------------------------------------------------------------------------
|
||||
|
@ -366,7 +366,7 @@ wait_for_supervisors(Monitors) ->
|
|||
60000 ->
|
||||
AliveLosers = [Node || {_, Node} <- pmon:monitored(Monitors)],
|
||||
?LOG_INFO("Autoheal: mnesia in nodes ~tp is still up, sending "
|
||||
"winner notification again to these ", [AliveLosers]),
|
||||
"winner notification again to these ", [AliveLosers]),
|
||||
_ = [send(L, {winner_is, node()}) || L <- AliveLosers],
|
||||
wait_for_mnesia_shutdown(AliveLosers)
|
||||
end
|
||||
|
|
|
@ -49,11 +49,11 @@ find_steps(Apps) ->
|
|||
run_step(Attributes, AttributeName) ->
|
||||
_ = [begin
|
||||
?LOG_DEBUG("Applying MFA: M = ~ts, F = ~ts, A = ~tp",
|
||||
[M, F, A]),
|
||||
[M, F, A]),
|
||||
case apply(M,F,A) of
|
||||
ok ->
|
||||
?LOG_DEBUG("Finished MFA: M = ~ts, F = ~ts, A = ~tp",
|
||||
[M, F, A]);
|
||||
[M, F, A]);
|
||||
{error, Reason} -> exit({error, Reason})
|
||||
end
|
||||
end
|
||||
|
|
|
@ -185,8 +185,8 @@ delete(Q0, IfUnused, IfEmpty, ActingUser) when ?amqqueue_is_classic(Q0) ->
|
|||
{error, not_empty};
|
||||
false ->
|
||||
?LOG_WARNING("Queue ~ts in vhost ~ts is down. "
|
||||
"Forcing queue deletion.",
|
||||
[Name, Vhost]),
|
||||
"Forcing queue deletion.",
|
||||
[Name, Vhost]),
|
||||
case delete_crashed_internal(Q, ActingUser) of
|
||||
ok ->
|
||||
{ok, 0};
|
||||
|
|
|
@ -257,8 +257,8 @@ recover(#resource{ virtual_host = VHost, name = QueueName } = Name, Terms,
|
|||
ContainsCheckFun, OnSyncFun, OnSyncMsgFun,
|
||||
CountersRef, Context),
|
||||
?LOG_WARNING("Queue ~ts in vhost ~ts dropped ~b/~b/~b persistent messages "
|
||||
"and ~b transient messages after unclean shutdown",
|
||||
[QueueName, VHost,
|
||||
"and ~b transient messages after unclean shutdown",
|
||||
[QueueName, VHost,
|
||||
counters:get(CountersRef, ?RECOVER_DROPPED_PERSISTENT_PER_VHOST),
|
||||
counters:get(CountersRef, ?RECOVER_DROPPED_PERSISTENT_PER_QUEUE),
|
||||
counters:get(CountersRef, ?RECOVER_DROPPED_PERSISTENT_OTHER),
|
||||
|
@ -331,7 +331,7 @@ recover_segments(State0, ContainsCheckFun, StoreState0, CountersRef, [Segment|Ta
|
|||
%% We cannot recover this file.
|
||||
_ ->
|
||||
?LOG_WARNING("Deleting invalid v2 segment file ~ts (file has invalid header)",
|
||||
[SegmentFile]),
|
||||
[SegmentFile]),
|
||||
ok = file:close(Fd),
|
||||
_ = prim_file:delete(SegmentFile),
|
||||
StoreState = rabbit_classic_queue_store_v2:delete_segments([Segment], StoreState0),
|
||||
|
|
|
@ -224,9 +224,9 @@ join(RemoteNode, NodeType)
|
|||
%% Attempt to leave the RemoteNode cluster, the discovery cluster,
|
||||
%% and simply retry the operation.
|
||||
?LOG_INFO("Mnesia: node ~tp thinks it's clustered "
|
||||
"with node ~tp, but ~tp disagrees. ~tp will ask "
|
||||
"to leave the cluster and try again.",
|
||||
[RemoteNode, node(), node(), node()]),
|
||||
"with node ~tp, but ~tp disagrees. ~tp will ask "
|
||||
"to leave the cluster and try again.",
|
||||
[RemoteNode, node(), node(), node()]),
|
||||
ok = rabbit_mnesia:leave_then_rediscover_cluster(RemoteNode),
|
||||
join(RemoteNode, NodeType)
|
||||
end;
|
||||
|
|
|
@ -343,7 +343,7 @@ count(VHostName) ->
|
|||
list_for_count(VHostName)
|
||||
catch _:Err ->
|
||||
?LOG_ERROR("Failed to fetch number of queues in vhost ~p:~n~p",
|
||||
[VHostName, Err]),
|
||||
[VHostName, Err]),
|
||||
0
|
||||
end.
|
||||
|
||||
|
|
|
@ -469,8 +469,8 @@ should_skip_if_unchanged() ->
|
|||
|
||||
log_an_error_about_orphaned_objects() ->
|
||||
?LOG_ERROR("Definitions import: some queues, exchanges or bindings in the definition file "
|
||||
"are missing the virtual host field. Such files are produced when definitions of "
|
||||
"a single virtual host are exported. They cannot be used to import definitions at boot time").
|
||||
"are missing the virtual host field. Such files are produced when definitions of "
|
||||
"a single virtual host are exported. They cannot be used to import definitions at boot time").
|
||||
|
||||
-spec apply_defs(Map :: #{atom() => any()}, ActingUser :: rabbit_types:username()) -> 'ok' | {error, term()}.
|
||||
|
||||
|
@ -526,8 +526,8 @@ apply_defs(Map, ActingUser, SuccessFun) when is_function(SuccessFun) ->
|
|||
|
||||
fun() ->
|
||||
?LOG_INFO("There are fewer than target cluster size (~b) nodes online,"
|
||||
" skipping queue and binding import from definitions",
|
||||
[rabbit_nodes:target_cluster_size_hint()])
|
||||
" skipping queue and binding import from definitions",
|
||||
[rabbit_nodes:target_cluster_size_hint()])
|
||||
end
|
||||
),
|
||||
|
||||
|
@ -564,8 +564,8 @@ apply_defs(Map, ActingUser, SuccessFun, VHost) when is_function(SuccessFun); is_
|
|||
|
||||
fun() ->
|
||||
?LOG_INFO("There are fewer than target cluster size (~b) nodes online,"
|
||||
" skipping queue and binding import from definitions",
|
||||
[rabbit_nodes:target_cluster_size_hint()])
|
||||
" skipping queue and binding import from definitions",
|
||||
[rabbit_nodes:target_cluster_size_hint()])
|
||||
end
|
||||
),
|
||||
|
||||
|
@ -827,11 +827,11 @@ add_queue_int(_Queue, R = #resource{kind = queue,
|
|||
name = <<"amq.", _/binary>>}, ActingUser) ->
|
||||
Name = R#resource.name,
|
||||
?LOG_WARNING("Skipping import of a queue whose name begins with 'amq.', "
|
||||
"name: ~ts, acting user: ~ts", [Name, ActingUser]);
|
||||
"name: ~ts, acting user: ~ts", [Name, ActingUser]);
|
||||
add_queue_int(_Queue, R = #resource{kind = queue, virtual_host = undefined}, ActingUser) ->
|
||||
Name = R#resource.name,
|
||||
?LOG_WARNING("Skipping import of a queue with an unset virtual host field, "
|
||||
"name: ~ts, acting user: ~ts", [Name, ActingUser]);
|
||||
"name: ~ts, acting user: ~ts", [Name, ActingUser]);
|
||||
add_queue_int(Queue, Name = #resource{virtual_host = VHostName}, ActingUser) ->
|
||||
case rabbit_amqqueue:exists(Name) of
|
||||
true ->
|
||||
|
@ -868,7 +868,7 @@ add_exchange_int(_Exchange, R = #resource{kind = exchange,
|
|||
name = <<"amq.", _/binary>>}, ActingUser) ->
|
||||
Name = R#resource.name,
|
||||
?LOG_WARNING("Skipping import of an exchange whose name begins with 'amq.', "
|
||||
"name: ~ts, acting user: ~ts", [Name, ActingUser]);
|
||||
"name: ~ts, acting user: ~ts", [Name, ActingUser]);
|
||||
add_exchange_int(Exchange, Name, ActingUser) ->
|
||||
case rabbit_exchange:exists(Name) of
|
||||
true ->
|
||||
|
|
|
@ -62,7 +62,7 @@ load_with_hashing(Proplist, PreviousHash, Algo) ->
|
|||
URL = pget(url, Proplist),
|
||||
?LOG_INFO("Applying definitions from a remote URL"),
|
||||
?LOG_DEBUG("Loading definitions with content hashing enabled, HTTPS URL: ~ts, previous hash value: ~ts",
|
||||
[URL, rabbit_misc:hexify(PreviousHash)]),
|
||||
[URL, rabbit_misc:hexify(PreviousHash)]),
|
||||
|
||||
TLSOptions = tls_options_or_default(Proplist),
|
||||
HTTPOptions = http_options(TLSOptions),
|
||||
|
|
|
@ -96,8 +96,8 @@ load_with_hashing(IsDir, Path, PreviousHash, Algo) when is_boolean(IsDir) ->
|
|||
end;
|
||||
false ->
|
||||
?LOG_ERROR("Definitions file at path ~p failed validation. The file must be a valid JSON document "
|
||||
"and all virtual host-scoped resources must have a virtual host field to be set. "
|
||||
"Definition files exported for a single virtual host CANNOT be imported at boot time", [Path]),
|
||||
"and all virtual host-scoped resources must have a virtual host field to be set. "
|
||||
"Definition files exported for a single virtual host CANNOT be imported at boot time", [Path]),
|
||||
{error, not_json}
|
||||
end
|
||||
end.
|
||||
|
|
|
@ -149,7 +149,7 @@ init([Limit]) ->
|
|||
|
||||
handle_call({set_disk_free_limit, _}, _From, #state{enabled = false} = State) ->
|
||||
?LOG_INFO("Cannot set disk free limit: "
|
||||
"disabled disk free space monitoring", []),
|
||||
"disabled disk free space monitoring", []),
|
||||
{reply, ok, State};
|
||||
|
||||
handle_call({set_disk_free_limit, Limit}, _From, State) ->
|
||||
|
@ -313,8 +313,8 @@ get_disk_free(Dir, {win32, _}, not_used) ->
|
|||
case win32_get_drive_letter(Dir) of
|
||||
error ->
|
||||
?LOG_WARNING("Expected the mnesia directory absolute "
|
||||
"path to start with a drive letter like "
|
||||
"'C:'. The path is: '~tp'", [Dir]),
|
||||
"path to start with a drive letter like "
|
||||
"'C:'. The path is: '~tp'", [Dir]),
|
||||
{ok, Free} = win32_get_disk_free_dir(Dir),
|
||||
Free;
|
||||
DriveLetter ->
|
||||
|
@ -444,21 +444,21 @@ enable_handle_disk_free(DiskFree, State) when is_integer(DiskFree) ->
|
|||
enable_handle_total_memory(catch vm_memory_monitor:get_total_memory(), DiskFree, State);
|
||||
enable_handle_disk_free(Error, #state{interval = Interval, retries = Retries} = State) ->
|
||||
?LOG_WARNING("Free disk space monitor encountered an error "
|
||||
"(e.g. failed to parse output from OS tools). "
|
||||
"Retries left: ~b Error:~n~tp",
|
||||
[Retries, Error]),
|
||||
"(e.g. failed to parse output from OS tools). "
|
||||
"Retries left: ~b Error:~n~tp",
|
||||
[Retries, Error]),
|
||||
erlang:send_after(Interval, self(), try_enable),
|
||||
State#state{enabled = false}.
|
||||
|
||||
enable_handle_total_memory(TotalMemory, DiskFree, #state{limit = Limit} = State) when is_integer(TotalMemory) ->
|
||||
?LOG_INFO("Enabling free disk space monitoring "
|
||||
"(disk free space: ~b, total memory: ~b)", [DiskFree, TotalMemory]),
|
||||
"(disk free space: ~b, total memory: ~b)", [DiskFree, TotalMemory]),
|
||||
start_timer(set_disk_limits(State, Limit));
|
||||
enable_handle_total_memory(Error, _DiskFree, #state{interval = Interval, retries = Retries} = State) ->
|
||||
?LOG_WARNING("Free disk space monitor encountered an error "
|
||||
"retrieving total memory. "
|
||||
"Retries left: ~b Error:~n~tp",
|
||||
[Retries, Error]),
|
||||
"retrieving total memory. "
|
||||
"Retries left: ~b Error:~n~tp",
|
||||
[Retries, Error]),
|
||||
erlang:send_after(Interval, self(), try_enable),
|
||||
State#state{enabled = false}.
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ declare(XName, Type, Durable, AutoDelete, Internal, Args, Username) ->
|
|||
end;
|
||||
_ ->
|
||||
?LOG_WARNING("ignoring exchange.declare for exchange ~tp,
|
||||
exchange.delete in progress~n.", [XName]),
|
||||
exchange.delete in progress~n.", [XName]),
|
||||
{ok, X}
|
||||
end.
|
||||
|
||||
|
|
|
@ -1180,8 +1180,8 @@ eval_gc(RaAux, MacState,
|
|||
garbage_collect(),
|
||||
{memory, MemAfter} = erlang:process_info(self(), memory),
|
||||
?LOG_DEBUG("~ts: full GC sweep complete. "
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
AuxState#?AUX{gc = Gc#aux_gc{last_raft_idx = Idx}};
|
||||
_ ->
|
||||
AuxState
|
||||
|
@ -1197,8 +1197,8 @@ force_eval_gc(RaAux,
|
|||
garbage_collect(),
|
||||
{memory, MemAfter} = erlang:process_info(self(), memory),
|
||||
?LOG_DEBUG("~ts: full GC sweep complete. "
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
AuxState#?AUX{gc = Gc#aux_gc{last_raft_idx = Idx}};
|
||||
false ->
|
||||
AuxState
|
||||
|
@ -1548,7 +1548,7 @@ activate_next_consumer(#?STATE{consumers = Cons0,
|
|||
waiting_consumers = Waiting},
|
||||
Effects1 = consumer_update_active_effects(State, Active,
|
||||
false, waiting,
|
||||
Effects0),
|
||||
Effects0),
|
||||
Effects = consumer_update_active_effects(State, Consumer,
|
||||
true, single_active,
|
||||
Effects1),
|
||||
|
|
|
@ -147,13 +147,13 @@ enqueue(QName, Correlation, Msg,
|
|||
{reject_publish, State0};
|
||||
{error, {shutdown, delete}} ->
|
||||
?LOG_DEBUG("~ts: QQ ~ts tried to register enqueuer during delete shutdown",
|
||||
[?MODULE, rabbit_misc:rs(QName)]),
|
||||
[?MODULE, rabbit_misc:rs(QName)]),
|
||||
{reject_publish, State0};
|
||||
{timeout, _} ->
|
||||
{reject_publish, State0};
|
||||
Err ->
|
||||
?LOG_DEBUG("~ts: QQ ~ts error when registering enqueuer ~p",
|
||||
[?MODULE, rabbit_misc:rs(QName), Err]),
|
||||
[?MODULE, rabbit_misc:rs(QName), Err]),
|
||||
exit(Err)
|
||||
end;
|
||||
enqueue(_QName, _Correlation, _Msg,
|
||||
|
@ -632,10 +632,10 @@ handle_ra_event(QName, Leader, {applied, Seqs},
|
|||
when ActualLeader =/= OldLeader ->
|
||||
%% there is a new leader
|
||||
?LOG_DEBUG("~ts: Detected QQ leader change (applied) "
|
||||
"from ~w to ~w, "
|
||||
"resending ~b pending commands",
|
||||
[?MODULE, OldLeader, ActualLeader,
|
||||
maps:size(State1#state.pending)]),
|
||||
"from ~w to ~w, "
|
||||
"resending ~b pending commands",
|
||||
[?MODULE, OldLeader, ActualLeader,
|
||||
maps:size(State1#state.pending)]),
|
||||
resend_all_pending(State1#state{leader = ActualLeader});
|
||||
_ ->
|
||||
State1
|
||||
|
@ -702,9 +702,9 @@ handle_ra_event(QName, Leader, {machine, leader_change},
|
|||
%% we need to update leader
|
||||
%% and resend any pending commands
|
||||
?LOG_DEBUG("~ts: ~s Detected QQ leader change from ~w to ~w, "
|
||||
"resending ~b pending commands",
|
||||
[rabbit_misc:rs(QName), ?MODULE, OldLeader,
|
||||
Leader, maps:size(Pending)]),
|
||||
"resending ~b pending commands",
|
||||
[rabbit_misc:rs(QName), ?MODULE, OldLeader,
|
||||
Leader, maps:size(Pending)]),
|
||||
State = resend_all_pending(State0#state{leader = Leader}),
|
||||
{ok, State, []};
|
||||
handle_ra_event(_QName, _From, {rejected, {not_leader, Leader, _Seq}},
|
||||
|
@ -714,9 +714,9 @@ handle_ra_event(QName, _From, {rejected, {not_leader, Leader, _Seq}},
|
|||
#state{leader = OldLeader,
|
||||
pending = Pending} = State0) ->
|
||||
?LOG_DEBUG("~ts: ~s Detected QQ leader change (rejection) from ~w to ~w, "
|
||||
"resending ~b pending commands",
|
||||
[rabbit_misc:rs(QName), ?MODULE, OldLeader,
|
||||
Leader, maps:size(Pending)]),
|
||||
"resending ~b pending commands",
|
||||
[rabbit_misc:rs(QName), ?MODULE, OldLeader,
|
||||
Leader, maps:size(Pending)]),
|
||||
State = resend_all_pending(State0#state{leader = Leader}),
|
||||
{ok, cancel_timer(State), []};
|
||||
handle_ra_event(_QName, _From,
|
||||
|
@ -986,7 +986,7 @@ get_missing_deliveries(State, From, To, ConsumerTag) ->
|
|||
%% find local server
|
||||
ConsumerKey = consumer_key(ConsumerTag, State),
|
||||
?LOG_DEBUG("get_missing_deliveries for consumer '~s' from ~b to ~b",
|
||||
[ConsumerTag, From, To]),
|
||||
[ConsumerTag, From, To]),
|
||||
Cmd = {get_checked_out, ConsumerKey, lists:seq(From, To)},
|
||||
ServerId = find_local_or_leader(State),
|
||||
case ra:aux_command(ServerId, Cmd) of
|
||||
|
|
|
@ -259,7 +259,7 @@ ensure_worker_started(QRef, #?MODULE{consumer = #dlx_consumer{pid = Pid}}) ->
|
|||
case is_local_and_alive(Pid) of
|
||||
true ->
|
||||
?LOG_DEBUG("rabbit_fifo_dlx_worker ~tp already started for ~ts",
|
||||
[Pid, rabbit_misc:rs(QRef)]);
|
||||
[Pid, rabbit_misc:rs(QRef)]);
|
||||
false ->
|
||||
start_worker(QRef)
|
||||
end.
|
||||
|
@ -271,7 +271,7 @@ ensure_worker_started(QRef, #?MODULE{consumer = #dlx_consumer{pid = Pid}}) ->
|
|||
start_worker(QRef) ->
|
||||
{ok, Pid} = supervisor:start_child(rabbit_fifo_dlx_sup, [QRef]),
|
||||
?LOG_DEBUG("started rabbit_fifo_dlx_worker ~tp for ~ts",
|
||||
[Pid, rabbit_misc:rs(QRef)]).
|
||||
[Pid, rabbit_misc:rs(QRef)]).
|
||||
|
||||
ensure_worker_terminated(#?MODULE{consumer = undefined}) ->
|
||||
ok;
|
||||
|
|
|
@ -55,8 +55,8 @@ process_command(Cmd, #state{leader = Leader} = State, Tries) ->
|
|||
{error, non_local_leader};
|
||||
Err ->
|
||||
?LOG_WARNING("Failed to process command ~tp on quorum queue leader ~tp: ~tp~n"
|
||||
"Trying ~b more time(s)...",
|
||||
[Cmd, Leader, Err, Tries]),
|
||||
"Trying ~b more time(s)...",
|
||||
[Cmd, Leader, Err, Tries]),
|
||||
process_command(Cmd, State, Tries - 1)
|
||||
end.
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ handle_info({'DOWN', Ref, process, _, _},
|
|||
%% Source quorum queue is down. Therefore, terminate ourself.
|
||||
%% The new leader will re-create another dlx_worker.
|
||||
?LOG_DEBUG("~ts terminating itself because leader of ~ts is down...",
|
||||
[?MODULE, rabbit_misc:rs(QRef)]),
|
||||
[?MODULE, rabbit_misc:rs(QRef)]),
|
||||
supervisor:terminate_child(rabbit_fifo_dlx_sup, self());
|
||||
handle_info({{'DOWN', QName}, _MRef, process, QPid, Reason},
|
||||
#state{queue_type_state = QTypeState0} = State0) ->
|
||||
|
@ -221,7 +221,7 @@ remove_queue(QRef, #state{pendings = Pendings0,
|
|||
|
||||
wait_for_queue_deleted(QRef, 0) ->
|
||||
?LOG_DEBUG("Received deletion event for ~ts but queue still exists in ETS table.",
|
||||
[rabbit_misc:rs(QRef)]);
|
||||
[rabbit_misc:rs(QRef)]);
|
||||
wait_for_queue_deleted(QRef, N) ->
|
||||
case rabbit_amqqueue:exists(QRef) of
|
||||
false ->
|
||||
|
@ -291,8 +291,8 @@ rejected(SeqNo, Qs, Pendings)
|
|||
Pendings);
|
||||
false ->
|
||||
?LOG_DEBUG("Ignoring rejection for unknown sequence number ~b "
|
||||
"from target dead letter queues ~tp",
|
||||
[SeqNo, Qs]),
|
||||
"from target dead letter queues ~tp",
|
||||
[SeqNo, Qs]),
|
||||
Pendings
|
||||
end.
|
||||
|
||||
|
@ -388,8 +388,8 @@ deliver_to_queues(Msg, Options, Qs, #state{queue_type_state = QTypeState0,
|
|||
%% (and therefore preventing messages to get stuck in our 'unsettled' state).
|
||||
QNames = queue_names(Qs),
|
||||
?LOG_DEBUG("Failed to deliver message with seq_no ~b to "
|
||||
"queues ~tp: ~tp",
|
||||
[SeqNo, QNames, Reason]),
|
||||
"queues ~tp: ~tp",
|
||||
[SeqNo, QNames, Reason]),
|
||||
{State0#state{pendings = rejected(SeqNo, QNames, Pendings)}, []}
|
||||
end,
|
||||
handle_queue_actions(Actions, State).
|
||||
|
@ -421,8 +421,8 @@ handle_settled0(QRef, MsgSeq, #state{pendings = Pendings,
|
|||
State#state{pendings = maps:update(MsgSeq, Pend, Pendings)};
|
||||
error ->
|
||||
?LOG_DEBUG("Ignoring publisher confirm for unknown sequence number ~b "
|
||||
"from target dead letter ~ts",
|
||||
[MsgSeq, rabbit_misc:rs(QRef)]),
|
||||
"from target dead letter ~ts",
|
||||
[MsgSeq, rabbit_misc:rs(QRef)]),
|
||||
State
|
||||
end.
|
||||
|
||||
|
@ -627,12 +627,12 @@ log_missing_dlx_once(#state{exchange_ref = DlxResource,
|
|||
queue_ref = QueueResource,
|
||||
logged = Logged} = State) ->
|
||||
?LOG_WARNING("Cannot forward any dead-letter messages from source quorum ~ts because "
|
||||
"its configured dead-letter-exchange ~ts does not exist. "
|
||||
"Either create the configured dead-letter-exchange or re-configure "
|
||||
"the dead-letter-exchange policy for the source quorum queue to prevent "
|
||||
"dead-lettered messages from piling up in the source quorum queue. "
|
||||
"This message will not be logged again.",
|
||||
[rabbit_misc:rs(QueueResource), rabbit_misc:rs(DlxResource)]),
|
||||
"its configured dead-letter-exchange ~ts does not exist. "
|
||||
"Either create the configured dead-letter-exchange or re-configure "
|
||||
"the dead-letter-exchange policy for the source quorum queue to prevent "
|
||||
"dead-lettered messages from piling up in the source quorum queue. "
|
||||
"This message will not be logged again.",
|
||||
[rabbit_misc:rs(QueueResource), rabbit_misc:rs(DlxResource)]),
|
||||
State#state{logged = maps:put(missing_dlx, DlxResource, Logged)}.
|
||||
|
||||
log_no_route_once(#state{exchange_ref = SameDlx,
|
||||
|
@ -644,15 +644,15 @@ log_no_route_once(#state{queue_ref = QueueResource,
|
|||
routing_key = RoutingKey,
|
||||
logged = Logged} = State) ->
|
||||
?LOG_WARNING("Cannot forward any dead-letter messages from source quorum ~ts "
|
||||
"with configured dead-letter-exchange ~ts and configured "
|
||||
"dead-letter-routing-key '~ts'. This can happen either if the dead-letter "
|
||||
"routing topology is misconfigured (for example no queue bound to "
|
||||
"dead-letter-exchange or wrong dead-letter-routing-key configured) or if "
|
||||
"non-mirrored classic queues are bound whose host node is down. "
|
||||
"Fix this issue to prevent dead-lettered messages from piling up "
|
||||
"in the source quorum queue. "
|
||||
"This message will not be logged again.",
|
||||
[rabbit_misc:rs(QueueResource), rabbit_misc:rs(DlxResource), RoutingKey]),
|
||||
"with configured dead-letter-exchange ~ts and configured "
|
||||
"dead-letter-routing-key '~ts'. This can happen either if the dead-letter "
|
||||
"routing topology is misconfigured (for example no queue bound to "
|
||||
"dead-letter-exchange or wrong dead-letter-routing-key configured) or if "
|
||||
"non-mirrored classic queues are bound whose host node is down. "
|
||||
"Fix this issue to prevent dead-lettered messages from piling up "
|
||||
"in the source quorum queue. "
|
||||
"This message will not be logged again.",
|
||||
[rabbit_misc:rs(QueueResource), rabbit_misc:rs(DlxResource), RoutingKey]),
|
||||
State#state{logged = maps:put(no_route, {DlxResource, RoutingKey}, Logged)}.
|
||||
|
||||
log_cycles(Cycles, RoutingKeys, State) ->
|
||||
|
@ -665,8 +665,8 @@ log_cycle_once(Queues, RoutingKeys, #state{exchange_ref = DlxResource,
|
|||
queue_ref = QueueResource,
|
||||
logged = Logged} = State) ->
|
||||
?LOG_WARNING("Dead-letter queues cycle detected for source quorum ~ts "
|
||||
"with dead-letter exchange ~ts and routing keys ~tp: ~tp "
|
||||
"This message will not be logged again.",
|
||||
[rabbit_misc:rs(QueueResource), rabbit_misc:rs(DlxResource),
|
||||
RoutingKeys, Queues]),
|
||||
"with dead-letter exchange ~ts and routing keys ~tp: ~tp "
|
||||
"This message will not be logged again.",
|
||||
[rabbit_misc:rs(QueueResource), rabbit_misc:rs(DlxResource),
|
||||
RoutingKeys, Queues]),
|
||||
State#state{logged = maps:put({cycle, Queues}, true, Logged)}.
|
||||
|
|
|
@ -675,8 +675,8 @@ eval_gc(Log, #?STATE{cfg = #cfg{resource = QR}} = MacState,
|
|||
garbage_collect(),
|
||||
{memory, MemAfter} = erlang:process_info(self(), memory),
|
||||
?LOG_DEBUG("~ts: full GC sweep complete. "
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
AuxState#aux{gc = Gc#aux_gc{last_raft_idx = Idx}};
|
||||
_ ->
|
||||
AuxState
|
||||
|
|
|
@ -857,8 +857,8 @@ eval_gc(Log, #?STATE{cfg = #cfg{resource = QR}} = MacState,
|
|||
garbage_collect(),
|
||||
{memory, MemAfter} = erlang:process_info(self(), memory),
|
||||
?LOG_DEBUG("~ts: full GC sweep complete. "
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
AuxState#aux{gc = Gc#aux_gc{last_raft_idx = Idx}};
|
||||
_ ->
|
||||
AuxState
|
||||
|
@ -873,8 +873,8 @@ force_eval_gc(Log, #?STATE{cfg = #cfg{resource = QR}},
|
|||
garbage_collect(),
|
||||
{memory, MemAfter} = erlang:process_info(self(), memory),
|
||||
?LOG_DEBUG("~ts: full GC sweep complete. "
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
AuxState#aux{gc = Gc#aux_gc{last_raft_idx = Idx}};
|
||||
false ->
|
||||
AuxState
|
||||
|
|
|
@ -1174,8 +1174,8 @@ eval_gc(Log, #?STATE{cfg = #cfg{resource = QR}} = MacState,
|
|||
garbage_collect(),
|
||||
{memory, MemAfter} = erlang:process_info(self(), memory),
|
||||
?LOG_DEBUG("~ts: full GC sweep complete. "
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
AuxState#?AUX{gc = Gc#aux_gc{last_raft_idx = Idx}};
|
||||
_ ->
|
||||
AuxState
|
||||
|
@ -1190,8 +1190,8 @@ force_eval_gc(Log, #?STATE{cfg = #cfg{resource = QR}},
|
|||
garbage_collect(),
|
||||
{memory, MemAfter} = erlang:process_info(self(), memory),
|
||||
?LOG_DEBUG("~ts: full GC sweep complete. "
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
"Process memory changed from ~.2fMB to ~.2fMB.",
|
||||
[rabbit_misc:rs(QR), Mem/?MB, MemAfter/?MB]),
|
||||
AuxState#?AUX{gc = Gc#aux_gc{last_raft_idx = Idx}};
|
||||
false ->
|
||||
AuxState
|
||||
|
|
|
@ -32,7 +32,7 @@ node(Node, Timeout) ->
|
|||
|
||||
local() ->
|
||||
?LOG_WARNING("rabbitmqctl node_health_check and its HTTP API counterpart are DEPRECATED. "
|
||||
"See https://www.rabbitmq.com/docs/monitoring#health-checks for replacement options."),
|
||||
"See https://www.rabbitmq.com/docs/monitoring#health-checks for replacement options."),
|
||||
run_checks([list_channels, list_queues, alarms, rabbit_node_monitor]).
|
||||
|
||||
%%----------------------------------------------------------------------------
|
||||
|
|
|
@ -159,7 +159,7 @@ filter_out_drained_nodes_consistent_read(Nodes) ->
|
|||
suspend_all_client_listeners() ->
|
||||
Listeners = rabbit_networking:node_client_listeners(node()),
|
||||
?LOG_INFO("Asked to suspend ~b client connection listeners. "
|
||||
"No new client connections will be accepted until these listeners are resumed!", [length(Listeners)]),
|
||||
"No new client connections will be accepted until these listeners are resumed!", [length(Listeners)]),
|
||||
Results = lists:foldl(local_listener_fold_fun(fun ranch:suspend_listener/1), [], Listeners),
|
||||
lists:foldl(fun ok_or_first_error/2, ok, Results).
|
||||
|
||||
|
@ -170,7 +170,7 @@ suspend_all_client_listeners() ->
|
|||
resume_all_client_listeners() ->
|
||||
Listeners = rabbit_networking:node_client_listeners(node()),
|
||||
?LOG_INFO("Asked to resume ~b client connection listeners. "
|
||||
"New client connections will be accepted from now on", [length(Listeners)]),
|
||||
"New client connections will be accepted from now on", [length(Listeners)]),
|
||||
Results = lists:foldl(local_listener_fold_fun(fun ranch:resume_listener/1), [], Listeners),
|
||||
lists:foldl(fun ok_or_first_error/2, ok, Results).
|
||||
|
||||
|
|
|
@ -794,7 +794,7 @@ init([VHost, Type, BaseDir, ClientRefs, StartupFunState]) ->
|
|||
false -> "unclean"
|
||||
end,
|
||||
?LOG_DEBUG("Rebuilding message location index after ~ts shutdown...",
|
||||
[Cleanliness]),
|
||||
[Cleanliness]),
|
||||
{CurOffset, State1 = #msstate { current_file = CurFile }} =
|
||||
build_index(CleanShutdown, StartupFunState, State),
|
||||
?LOG_DEBUG("Finished rebuilding index", []),
|
||||
|
@ -986,9 +986,9 @@ terminate(Reason, State = #msstate { index_ets = IndexEts,
|
|||
ok -> ok;
|
||||
{error, FSErr} ->
|
||||
?LOG_ERROR("Unable to store file summary"
|
||||
" for vhost message store for directory ~tp~n"
|
||||
"Error: ~tp",
|
||||
[Dir, FSErr])
|
||||
" for vhost message store for directory ~tp~n"
|
||||
"Error: ~tp",
|
||||
[Dir, FSErr])
|
||||
end,
|
||||
[true = ets:delete(T) || T <- [FileSummaryEts, FileHandlesEts,
|
||||
CurFileCacheEts, FlyingEts]],
|
||||
|
@ -999,8 +999,8 @@ terminate(Reason, State = #msstate { index_ets = IndexEts,
|
|||
ok;
|
||||
{error, RTErr} ->
|
||||
?LOG_ERROR("Unable to save message store recovery terms"
|
||||
" for directory ~tp~nError: ~tp",
|
||||
[Dir, RTErr])
|
||||
" for directory ~tp~nError: ~tp",
|
||||
[Dir, RTErr])
|
||||
end,
|
||||
State3 #msstate { current_file_handle = undefined,
|
||||
current_file_offset = 0 }.
|
||||
|
@ -1705,8 +1705,8 @@ index_terminate(IndexEts, Dir) ->
|
|||
ok -> ok;
|
||||
{error, Err} ->
|
||||
?LOG_ERROR("Unable to save message store index"
|
||||
" for directory ~tp.~nError: ~tp",
|
||||
[Dir, Err])
|
||||
" for directory ~tp.~nError: ~tp",
|
||||
[Dir, Err])
|
||||
end,
|
||||
ets:delete(IndexEts).
|
||||
|
||||
|
@ -1722,8 +1722,8 @@ recover_index_and_client_refs(false, _ClientRefs, Dir, Name) ->
|
|||
recover_index_and_client_refs(true, ClientRefs, Dir, Name) ->
|
||||
Fresh = fun (ErrorMsg, ErrorArgs) ->
|
||||
?LOG_WARNING("Message store ~tp : " ++ ErrorMsg ++ "~n"
|
||||
"rebuilding indices from scratch",
|
||||
[Name | ErrorArgs]),
|
||||
"rebuilding indices from scratch",
|
||||
[Name | ErrorArgs]),
|
||||
{false, index_new(Dir), []}
|
||||
end,
|
||||
case read_recovery_terms(Dir) of
|
||||
|
@ -1831,7 +1831,7 @@ build_index_worker(Gatherer, #msstate { index_ets = IndexEts, dir = Dir },
|
|||
File, Files) ->
|
||||
Path = form_filename(Dir, filenum_to_name(File)),
|
||||
?LOG_DEBUG("Rebuilding message location index from ~ts (~B file(s) remaining)",
|
||||
[Path, length(Files)]),
|
||||
[Path, length(Files)]),
|
||||
%% The scan function already dealt with duplicate messages
|
||||
%% within the file, and only returns valid messages (we do
|
||||
%% the index lookup in the fun). But we get messages in reverse order.
|
||||
|
@ -2003,7 +2003,7 @@ compact_file(File, State = #gc_state { file_summary_ets = FileSummaryEts }) ->
|
|||
case ets:lookup(FileSummaryEts, File) of
|
||||
[] ->
|
||||
?LOG_DEBUG("File ~tp has already been deleted; no need to compact",
|
||||
[File]),
|
||||
[File]),
|
||||
ok;
|
||||
[#file_summary{file_size = FileSize}] ->
|
||||
compact_file(File, FileSize, State)
|
||||
|
@ -2048,7 +2048,7 @@ compact_file(File, FileSize,
|
|||
%% put out more details around what's happening.
|
||||
Reclaimed = FileSize - TruncateSize,
|
||||
?LOG_DEBUG("Compacted segment file number ~tp; ~tp bytes can now be reclaimed",
|
||||
[File, Reclaimed]),
|
||||
[File, Reclaimed]),
|
||||
%% Tell the message store to update its state.
|
||||
gen_server2:cast(Server, {compacted_file, File}),
|
||||
%% Tell the GC process to truncate the file.
|
||||
|
@ -2149,7 +2149,7 @@ truncate_file(File, Size, ThresholdTimestamp, #gc_state{ file_summary_ets = File
|
|||
[{'=<', '$1', ThresholdTimestamp}], ['$$']}], 1) of
|
||||
{[_|_], _Cont} ->
|
||||
?LOG_DEBUG("Asked to truncate file ~p but it has active readers. Deferring.",
|
||||
[File]),
|
||||
[File]),
|
||||
defer;
|
||||
_ ->
|
||||
FileName = filenum_to_name(File),
|
||||
|
@ -2172,7 +2172,7 @@ delete_file(File, #gc_state { file_summary_ets = FileSummaryEts,
|
|||
case ets:match_object(FileHandlesEts, {{'_', File}, '_'}, 1) of
|
||||
{[_|_], _Cont} ->
|
||||
?LOG_DEBUG("Asked to delete file ~p but it has active readers. Deferring.",
|
||||
[File]),
|
||||
[File]),
|
||||
defer;
|
||||
_ ->
|
||||
[#file_summary{ valid_total_size = 0,
|
||||
|
|
|
@ -105,7 +105,7 @@ boot_listeners(Fun, NumAcceptors, ConcurrentConnsSupsCount, Type) ->
|
|||
ok;
|
||||
{error, {could_not_start_listener, Address, Port, Details}} = Error ->
|
||||
?LOG_ERROR("Failed to start ~ts listener [~ts]:~tp, error: ~tp",
|
||||
[Type, Address, Port, Details]),
|
||||
[Type, Address, Port, Details]),
|
||||
throw(Error)
|
||||
end.
|
||||
|
||||
|
@ -522,11 +522,11 @@ emit_connection_info_local(Items, Ref, AggregatorPid) ->
|
|||
-spec close_connection(pid(), string()) -> 'ok'.
|
||||
close_connection(Pid, Explanation) ->
|
||||
?LOG_INFO("Closing connection ~tp because ~tp",
|
||||
[Pid, Explanation]),
|
||||
[Pid, Explanation]),
|
||||
try rabbit_reader:shutdown(Pid, Explanation)
|
||||
catch exit:{Reason, _Location} ->
|
||||
?LOG_WARNING("Could not close connection ~tp (reason: ~tp): ~p",
|
||||
[Pid, Explanation, Reason])
|
||||
[Pid, Explanation, Reason])
|
||||
end.
|
||||
|
||||
-spec close_connections([pid()], string()) -> 'ok'.
|
||||
|
@ -604,7 +604,7 @@ ranch_handshake(Ref) ->
|
|||
PeerAddress = io_lib:format("~ts:~tp", [rabbit_misc:ntoab(PeerIp), PeerPort]),
|
||||
Protocol = ranch_ref_to_protocol(Ref),
|
||||
?LOG_ERROR("~p error during handshake for protocol ~p and peer ~ts",
|
||||
[Reason, Protocol, PeerAddress]),
|
||||
[Reason, Protocol, PeerAddress]),
|
||||
erlang:raise(exit, Error, Stacktrace)
|
||||
end.
|
||||
|
||||
|
|
|
@ -318,8 +318,8 @@ find_blocked_global_peers() ->
|
|||
timer:sleep(10_000),
|
||||
Snapshot2 = snapshot_global_dict(),
|
||||
?LOG_DEBUG("global's sync tags 10s ago: ~p~n"
|
||||
"global's sync tags now: ~p",
|
||||
[Snapshot1, Snapshot2]),
|
||||
"global's sync tags now: ~p",
|
||||
[Snapshot1, Snapshot2]),
|
||||
find_blocked_global_peers1(Snapshot2, Snapshot1).
|
||||
|
||||
snapshot_global_dict() ->
|
||||
|
@ -496,9 +496,9 @@ handle_cast({check_partial_partition, Node, Rep, NodeGUID, MyGUID, RepGUID},
|
|||
{badrpc, _} -> ok;
|
||||
NodeGUID ->
|
||||
?LOG_WARNING("Received a 'DOWN' message"
|
||||
" from ~tp but still can"
|
||||
" communicate with it ",
|
||||
[Node]),
|
||||
" from ~tp but still can"
|
||||
" communicate with it ",
|
||||
[Node]),
|
||||
cast(Rep, {partial_partition,
|
||||
Node, node(), RepGUID});
|
||||
_ ->
|
||||
|
@ -657,7 +657,7 @@ handle_info({'DOWN', _MRef, process, Pid, _Reason},
|
|||
|
||||
handle_info({nodedown, Node, Info}, State) ->
|
||||
?LOG_INFO("node ~tp down: ~tp",
|
||||
[Node, proplists:get_value(nodedown_reason, Info)]),
|
||||
[Node, proplists:get_value(nodedown_reason, Info)]),
|
||||
case rabbit_khepri:is_enabled() of
|
||||
true -> {noreply, State};
|
||||
false -> handle_nodedown_using_mnesia(Node, State)
|
||||
|
@ -785,13 +785,13 @@ handle_dead_node(Node, State = #state{autoheal = Autoheal}) ->
|
|||
State#state{autoheal = rabbit_autoheal:node_down(Node, Autoheal)};
|
||||
{ok, Term} ->
|
||||
?LOG_WARNING("cluster_partition_handling ~tp unrecognised, "
|
||||
"assuming 'ignore'", [Term]),
|
||||
"assuming 'ignore'", [Term]),
|
||||
State
|
||||
end.
|
||||
|
||||
await_cluster_recovery(Condition) ->
|
||||
?LOG_WARNING("Cluster minority/secondary status detected - "
|
||||
"awaiting recovery", []),
|
||||
"awaiting recovery", []),
|
||||
run_outside_applications(fun () ->
|
||||
rabbit:stop(),
|
||||
wait_for_cluster_recovery(Condition)
|
||||
|
|
|
@ -46,8 +46,8 @@ check_duplicates(Nodes) ->
|
|||
ok;
|
||||
false ->
|
||||
?LOG_WARNING("Classic peer discovery backend: list of "
|
||||
"nodes contains duplicates ~0tp",
|
||||
[Nodes])
|
||||
"nodes contains duplicates ~0tp",
|
||||
[Nodes])
|
||||
end.
|
||||
|
||||
check_local_node(Nodes) ->
|
||||
|
@ -56,8 +56,8 @@ check_local_node(Nodes) ->
|
|||
ok;
|
||||
false ->
|
||||
?LOG_WARNING("Classic peer discovery backend: list of "
|
||||
"nodes does not contain the local node ~0tp",
|
||||
[Nodes])
|
||||
"nodes does not contain the local node ~0tp",
|
||||
[Nodes])
|
||||
end.
|
||||
|
||||
-spec lock(Nodes :: [node()]) ->
|
||||
|
@ -69,7 +69,7 @@ lock(Nodes) ->
|
|||
case lists:member(Node, Nodes) of
|
||||
false when Nodes =/= [] ->
|
||||
?LOG_WARNING("Local node ~ts is not part of configured nodes ~tp. "
|
||||
"This might lead to incorrect cluster formation.", [Node, Nodes]);
|
||||
"This might lead to incorrect cluster formation.", [Node, Nodes]);
|
||||
_ -> ok
|
||||
end,
|
||||
LockId = rabbit_nodes:lock_id(Node),
|
||||
|
|
|
@ -31,9 +31,9 @@ list_nodes() ->
|
|||
case proplists:get_value(peer_discovery_dns, ClusterFormation) of
|
||||
undefined ->
|
||||
?LOG_WARNING("Peer discovery backend is set to ~ts "
|
||||
"but final config does not contain rabbit.cluster_formation.peer_discovery_dns. "
|
||||
"Cannot discover any nodes because seed hostname is not configured!",
|
||||
[?MODULE]),
|
||||
"but final config does not contain rabbit.cluster_formation.peer_discovery_dns. "
|
||||
"Cannot discover any nodes because seed hostname is not configured!",
|
||||
[?MODULE]),
|
||||
{ok, {[], disc}};
|
||||
Proplist ->
|
||||
Hostname = rabbit_data_coercion:to_list(proplists:get_value(hostname, Proplist)),
|
||||
|
@ -110,5 +110,5 @@ extract_host({ok, {hostent, FQDN, _, _, _, _}}, false, _Address) ->
|
|||
lists:nth(1, string:tokens(FQDN, "."));
|
||||
extract_host({error, Error}, _, Address) ->
|
||||
?LOG_ERROR("Reverse DNS lookup for address ~ts failed: ~tp",
|
||||
[inet_parse:ntoa(Address), Error]),
|
||||
[inet_parse:ntoa(Address), Error]),
|
||||
error.
|
||||
|
|
|
@ -55,14 +55,12 @@ ensure1(FileJustChanged0) ->
|
|||
{[], []} ->
|
||||
ok;
|
||||
{[], _} ->
|
||||
?LOG_INFO("Plugins changed; disabled ~tp",
|
||||
[Stop]);
|
||||
?LOG_INFO("Plugins changed; disabled ~tp", [Stop]);
|
||||
{_, []} ->
|
||||
?LOG_INFO("Plugins changed; enabled ~tp",
|
||||
[Start]);
|
||||
?LOG_INFO("Plugins changed; enabled ~tp", [Start]);
|
||||
{_, _} ->
|
||||
?LOG_INFO("Plugins changed; enabled ~tp, disabled ~tp",
|
||||
[Start, Stop])
|
||||
[Start, Stop])
|
||||
end,
|
||||
{ok, Start, Stop};
|
||||
_ ->
|
||||
|
@ -428,9 +426,9 @@ prepare_dir_plugin(PluginAppDescPath) ->
|
|||
ok;
|
||||
{error, badfile} ->
|
||||
?LOG_ERROR("Failed to enable plugin \"~ts\": "
|
||||
"it may have been built with an "
|
||||
"incompatible (more recent?) "
|
||||
"version of Erlang", [Plugin]),
|
||||
"it may have been built with an "
|
||||
"incompatible (more recent?) "
|
||||
"version of Erlang", [Plugin]),
|
||||
throw({plugin_built_with_incompatible_erlang, Plugin});
|
||||
Error ->
|
||||
throw({plugin_module_unloadable, Plugin, Error})
|
||||
|
|
|
@ -287,7 +287,7 @@ parse_set0(Type, VHost, Name, Pattern, Defn, Priority, ApplyTo, ActingUser) ->
|
|||
{<<"apply-to">>, ApplyTo}],
|
||||
ActingUser),
|
||||
?LOG_INFO("Successfully set policy '~ts' matching ~ts names in virtual host '~ts' using pattern '~ts'",
|
||||
[Name, ApplyTo, VHost, Pattern]),
|
||||
[Name, ApplyTo, VHost, Pattern]),
|
||||
R;
|
||||
{error, Reason} ->
|
||||
{error_string,
|
||||
|
|
|
@ -68,7 +68,7 @@ enable() ->
|
|||
case RealBQ of
|
||||
?MODULE -> ok;
|
||||
_ -> ?LOG_INFO("Priority queues enabled, real BQ is ~ts",
|
||||
[RealBQ]),
|
||||
[RealBQ]),
|
||||
application:set_env(
|
||||
rabbitmq_priority_queue, backing_queue_module, RealBQ),
|
||||
application:set_env(rabbit, backing_queue_module, ?MODULE)
|
||||
|
|
|
@ -1184,7 +1184,7 @@ load_segment(KeepAcked, #segment { path = Path }) ->
|
|||
case SegBin of
|
||||
<<0:Size/unit:8>> ->
|
||||
?LOG_WARNING("Deleting invalid v1 segment file ~ts (file only contains NUL bytes)",
|
||||
[Path]),
|
||||
[Path]),
|
||||
_ = rabbit_file:delete(Path),
|
||||
Empty;
|
||||
_ ->
|
||||
|
|
|
@ -556,7 +556,7 @@ recover(VHost, Qs) ->
|
|||
maps:fold(fun (Mod, Queues, {R0, F0}) ->
|
||||
{Taken, {R, F}} = timer:tc(Mod, recover, [VHost, Queues]),
|
||||
?LOG_INFO("Recovering ~b queues of type ~ts took ~bms",
|
||||
[length(Queues), Mod, Taken div 1000]),
|
||||
[length(Queues), Mod, Taken div 1000]),
|
||||
{R0 ++ R, F0 ++ F}
|
||||
end, {[], []}, ByType).
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
|
||||
-define(INFO(Str, Args),
|
||||
?LOG_INFO("[~s:~s/~b] " Str,
|
||||
[?MODULE, ?FUNCTION_NAME, ?FUNCTION_ARITY | Args])).
|
||||
[?MODULE, ?FUNCTION_NAME, ?FUNCTION_ARITY | Args])).
|
||||
|
||||
|
||||
-define(STATISTICS_KEYS,
|
||||
|
@ -286,8 +286,8 @@ start_cluster(Q) ->
|
|||
MinVersion = lists:min([rabbit_fifo:version() | Versions]),
|
||||
|
||||
?LOG_DEBUG("Will start up to ~w replicas for quorum queue ~ts with "
|
||||
"leader on node '~ts', initial machine version ~b",
|
||||
[QuorumSize, rabbit_misc:rs(QName), LeaderNode, MinVersion]),
|
||||
"leader on node '~ts', initial machine version ~b",
|
||||
[QuorumSize, rabbit_misc:rs(QName), LeaderNode, MinVersion]),
|
||||
case rabbit_amqqueue:internal_declare(NewQ1, false) of
|
||||
{created, NewQ} ->
|
||||
RaConfs = [make_ra_conf(NewQ, ServerId, voter, MinVersion)
|
||||
|
@ -662,7 +662,7 @@ handle_tick(QName,
|
|||
ok;
|
||||
repaired ->
|
||||
?LOG_DEBUG("Repaired quorum queue ~ts amqqueue record",
|
||||
[rabbit_misc:rs(QName)])
|
||||
[rabbit_misc:rs(QName)])
|
||||
end,
|
||||
ExpectedNodes = rabbit_nodes:list_members(),
|
||||
case Nodes -- ExpectedNodes of
|
||||
|
@ -672,8 +672,8 @@ handle_tick(QName,
|
|||
%% rabbit_nodes:list_members/0 returns [] when there
|
||||
%% is an error so we need to handle that case
|
||||
?LOG_DEBUG("~ts: stale nodes detected in quorum "
|
||||
"queue state. Purging ~w",
|
||||
[rabbit_misc:rs(QName), Stale]),
|
||||
"queue state. Purging ~w",
|
||||
[rabbit_misc:rs(QName), Stale]),
|
||||
%% pipeline purge command
|
||||
ok = ra:pipeline_command(amqqueue:get_pid(Q),
|
||||
rabbit_fifo:make_purge_nodes(Stale)),
|
||||
|
@ -686,13 +686,13 @@ handle_tick(QName,
|
|||
catch
|
||||
_:Err ->
|
||||
?LOG_DEBUG("~ts: handle tick failed with ~p",
|
||||
[rabbit_misc:rs(QName), Err]),
|
||||
[rabbit_misc:rs(QName), Err]),
|
||||
ok
|
||||
end
|
||||
end);
|
||||
handle_tick(QName, Config, _Nodes) ->
|
||||
?LOG_DEBUG("~ts: handle tick received unexpected config format ~tp",
|
||||
[rabbit_misc:rs(QName), Config]).
|
||||
[rabbit_misc:rs(QName), Config]).
|
||||
|
||||
repair_leader_record(Q, Name) ->
|
||||
Node = node(),
|
||||
|
@ -703,7 +703,7 @@ repair_leader_record(Q, Name) ->
|
|||
_ ->
|
||||
QName = amqqueue:get_name(Q),
|
||||
?LOG_DEBUG("~ts: updating leader record to current node ~ts",
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
ok = become_leader0(QName, Name),
|
||||
ok
|
||||
end,
|
||||
|
@ -800,15 +800,15 @@ recover(_Vhost, Queues) ->
|
|||
when Err1 == not_started orelse
|
||||
Err1 == name_not_registered ->
|
||||
?LOG_WARNING("Quorum queue recovery: configured member of ~ts was not found on this node. Starting member as a new one. "
|
||||
"Context: ~s",
|
||||
[rabbit_misc:rs(QName), Err1]),
|
||||
"Context: ~s",
|
||||
[rabbit_misc:rs(QName), Err1]),
|
||||
% queue was never started on this node
|
||||
% so needs to be started from scratch.
|
||||
case start_server(make_ra_conf(Q0, ServerId)) of
|
||||
ok -> ok;
|
||||
Err2 ->
|
||||
?LOG_WARNING("recover: quorum queue ~w could not"
|
||||
" be started ~w", [Name, Err2]),
|
||||
" be started ~w", [Name, Err2]),
|
||||
fail
|
||||
end;
|
||||
{error, {already_started, _}} ->
|
||||
|
@ -819,7 +819,7 @@ recover(_Vhost, Queues) ->
|
|||
Err ->
|
||||
%% catch all clause to avoid causing the vhost not to start
|
||||
?LOG_WARNING("recover: quorum queue ~w could not be "
|
||||
"restarted ~w", [Name, Err]),
|
||||
"restarted ~w", [Name, Err]),
|
||||
fail
|
||||
end,
|
||||
%% we have to ensure the quorum queue is
|
||||
|
@ -1224,7 +1224,7 @@ policy_changed(Q) ->
|
|||
Err ->
|
||||
FormattedQueueName = rabbit_misc:rs(amqqueue:get_name(Q)),
|
||||
?LOG_WARNING("~s: policy may not have been successfully applied. Error: ~p",
|
||||
[FormattedQueueName, Err]),
|
||||
[FormattedQueueName, Err]),
|
||||
ok
|
||||
end.
|
||||
|
||||
|
@ -1342,7 +1342,7 @@ add_member(VHost, Name, Node, Membership, Timeout)
|
|||
is_atom(Node) ->
|
||||
QName = #resource{virtual_host = VHost, name = Name, kind = queue},
|
||||
?LOG_DEBUG("Asked to add a replica for queue ~ts on node ~ts",
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
case rabbit_amqqueue:lookup(QName) of
|
||||
{ok, Q} when ?amqqueue_is_classic(Q) ->
|
||||
{error, classic_queue_not_supported};
|
||||
|
@ -1356,7 +1356,7 @@ add_member(VHost, Name, Node, Membership, Timeout)
|
|||
true ->
|
||||
%% idempotent by design
|
||||
?LOG_DEBUG("Quorum ~ts already has a replica on node ~ts",
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
ok;
|
||||
false ->
|
||||
do_add_member(Q, Node, Membership, Timeout)
|
||||
|
@ -1435,7 +1435,7 @@ do_add_member(Q, Node, Membership, Timeout)
|
|||
end;
|
||||
E ->
|
||||
?LOG_WARNING("Could not add a replica of quorum ~ts on node ~ts: ~p",
|
||||
[rabbit_misc:rs(QName), Node, E]),
|
||||
[rabbit_misc:rs(QName), Node, E]),
|
||||
E
|
||||
end.
|
||||
|
||||
|
@ -1512,7 +1512,7 @@ shrink_all(Node) ->
|
|||
[begin
|
||||
QName = amqqueue:get_name(Q),
|
||||
?LOG_INFO("~ts: removing member (replica) on node ~w",
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
Size = length(get_nodes(Q)),
|
||||
case delete_member(Q, Node) of
|
||||
ok ->
|
||||
|
@ -1522,21 +1522,21 @@ shrink_all(Node) ->
|
|||
%% elected but it's noop command not been committed yet.
|
||||
%% lets sleep and retry once
|
||||
?LOG_INFO("~ts: failed to remove member (replica) on node ~w "
|
||||
"as cluster change is not permitted. "
|
||||
"retrying once in 500ms",
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
"as cluster change is not permitted. "
|
||||
"retrying once in 500ms",
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
timer:sleep(500),
|
||||
case delete_member(Q, Node) of
|
||||
ok ->
|
||||
{QName, {ok, Size-1}};
|
||||
{error, Err} ->
|
||||
?LOG_WARNING("~ts: failed to remove member (replica) on node ~w, error: ~w",
|
||||
[rabbit_misc:rs(QName), Node, Err]),
|
||||
[rabbit_misc:rs(QName), Node, Err]),
|
||||
{QName, {error, Size, Err}}
|
||||
end;
|
||||
{error, Err} ->
|
||||
?LOG_WARNING("~ts: failed to remove member (replica) on node ~w, error: ~w",
|
||||
[rabbit_misc:rs(QName), Node, Err]),
|
||||
[rabbit_misc:rs(QName), Node, Err]),
|
||||
{QName, {error, Size, Err}}
|
||||
end
|
||||
end || Q <- rabbit_amqqueue:list(),
|
||||
|
@ -1556,7 +1556,7 @@ grow(Node, VhostSpec, QueueSpec, Strategy, Membership) ->
|
|||
Size = length(get_nodes(Q)),
|
||||
QName = amqqueue:get_name(Q),
|
||||
?LOG_INFO("~ts: adding a new member (replica) on node ~w",
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
case add_member(Q, Node, Membership) of
|
||||
ok ->
|
||||
{QName, {ok, Size + 1}};
|
||||
|
@ -1649,22 +1649,22 @@ dlh(undefined, undefined, undefined, _, _) ->
|
|||
undefined;
|
||||
dlh(undefined, RoutingKey, undefined, _, QName) ->
|
||||
?LOG_WARNING("Disabling dead-lettering for ~ts despite configured dead-letter-routing-key '~ts' "
|
||||
"because dead-letter-exchange is not configured.",
|
||||
"because dead-letter-exchange is not configured.",
|
||||
[rabbit_misc:rs(QName), RoutingKey]),
|
||||
undefined;
|
||||
dlh(undefined, _, Strategy, _, QName) ->
|
||||
?LOG_WARNING("Disabling dead-lettering for ~ts despite configured dead-letter-strategy '~ts' "
|
||||
"because dead-letter-exchange is not configured.",
|
||||
[rabbit_misc:rs(QName), Strategy]),
|
||||
"because dead-letter-exchange is not configured.",
|
||||
[rabbit_misc:rs(QName), Strategy]),
|
||||
undefined;
|
||||
dlh(_, _, <<"at-least-once">>, reject_publish, _) ->
|
||||
at_least_once;
|
||||
dlh(Exchange, RoutingKey, <<"at-least-once">>, drop_head, QName) ->
|
||||
?LOG_WARNING("Falling back to dead-letter-strategy at-most-once for ~ts "
|
||||
"because configured dead-letter-strategy at-least-once is incompatible with "
|
||||
"effective overflow strategy drop-head. To enable dead-letter-strategy "
|
||||
"at-least-once, set overflow strategy to reject-publish.",
|
||||
[rabbit_misc:rs(QName)]),
|
||||
"because configured dead-letter-strategy at-least-once is incompatible with "
|
||||
"effective overflow strategy drop-head. To enable dead-letter-strategy "
|
||||
"at-least-once, set overflow strategy to reject-publish.",
|
||||
[rabbit_misc:rs(QName)]),
|
||||
dlh_at_most_once(Exchange, RoutingKey, QName);
|
||||
dlh(Exchange, RoutingKey, _, _, QName) ->
|
||||
dlh_at_most_once(Exchange, RoutingKey, QName).
|
||||
|
@ -2032,7 +2032,7 @@ overflow(<<"reject-publish">>, _Def, _QName) -> reject_publish;
|
|||
overflow(<<"drop-head">>, _Def, _QName) -> drop_head;
|
||||
overflow(<<"reject-publish-dlx">> = V, Def, QName) ->
|
||||
?LOG_WARNING("Invalid overflow strategy ~tp for quorum queue: ~ts",
|
||||
[V, rabbit_misc:rs(QName)]),
|
||||
[V, rabbit_misc:rs(QName)]),
|
||||
Def.
|
||||
|
||||
-spec notify_decorators(amqqueue:amqqueue()) -> 'ok'.
|
||||
|
@ -2144,7 +2144,7 @@ force_checkpoint(VhostSpec, QueueSpec) ->
|
|||
{QName, {ok}};
|
||||
{error, Err} ->
|
||||
?LOG_WARNING("~ts: failed to force checkpoint, error: ~w",
|
||||
[rabbit_misc:rs(QName), Err]),
|
||||
[rabbit_misc:rs(QName), Err]),
|
||||
{QName, {error, Err}}
|
||||
end
|
||||
end
|
||||
|
@ -2297,16 +2297,16 @@ drain(TransferCandidates) ->
|
|||
|
||||
transfer_leadership([]) ->
|
||||
?LOG_WARNING("Skipping leadership transfer of quorum queues: no candidate "
|
||||
"(online, not under maintenance) nodes to transfer to!");
|
||||
"(online, not under maintenance) nodes to transfer to!");
|
||||
transfer_leadership(_TransferCandidates) ->
|
||||
%% we only transfer leadership for QQs that have local leaders
|
||||
Queues = rabbit_amqqueue:list_local_leaders(),
|
||||
?LOG_INFO("Will transfer leadership of ~b quorum queues with current leader on this node",
|
||||
[length(Queues)]),
|
||||
[length(Queues)]),
|
||||
_ = [begin
|
||||
Name = amqqueue:get_name(Q),
|
||||
?LOG_DEBUG("Will trigger a leader election for local quorum queue ~ts",
|
||||
[rabbit_misc:rs(Name)]),
|
||||
[rabbit_misc:rs(Name)]),
|
||||
%% we trigger an election and exclude this node from the list of candidates
|
||||
%% by simply shutting its local QQ replica (Ra server)
|
||||
RaLeader = amqqueue:get_pid(Q),
|
||||
|
@ -2325,11 +2325,11 @@ transfer_leadership(_TransferCandidates) ->
|
|||
stop_local_quorum_queue_followers() ->
|
||||
Queues = rabbit_amqqueue:list_local_followers(),
|
||||
?LOG_INFO("Will stop local follower replicas of ~b quorum queues on this node",
|
||||
[length(Queues)]),
|
||||
[length(Queues)]),
|
||||
_ = [begin
|
||||
Name = amqqueue:get_name(Q),
|
||||
?LOG_DEBUG("Will stop a local follower replica of quorum queue ~ts",
|
||||
[rabbit_misc:rs(Name)]),
|
||||
[rabbit_misc:rs(Name)]),
|
||||
%% shut down Ra nodes so that they are not considered for leader election
|
||||
{RegisteredName, _LeaderNode} = amqqueue:get_pid(Q),
|
||||
RaNode = {RegisteredName, node()},
|
||||
|
@ -2352,13 +2352,13 @@ revive_local_queue_members() ->
|
|||
%% empty binary as the vhost name.
|
||||
{Recovered, Failed} = rabbit_quorum_queue:recover(<<>>, Queues),
|
||||
?LOG_DEBUG("Successfully revived ~b quorum queue replicas",
|
||||
[length(Recovered)]),
|
||||
[length(Recovered)]),
|
||||
case length(Failed) of
|
||||
0 ->
|
||||
ok;
|
||||
NumFailed ->
|
||||
?LOG_ERROR("Failed to revive ~b quorum queue replicas",
|
||||
[NumFailed])
|
||||
[NumFailed])
|
||||
end,
|
||||
|
||||
?LOG_INFO("Restart of local quorum queue replicas is complete"),
|
||||
|
|
|
@ -242,8 +242,8 @@ remove_members(Q, [Node | Nodes]) ->
|
|||
{error, Err} ->
|
||||
QName = amqqueue:get_name(Q),
|
||||
?LOG_DEBUG("~ts: failed to remove member (replica) on node "
|
||||
"~w, error: ~w",
|
||||
[rabbit_misc:rs(QName), Node, Err])
|
||||
"~w, error: ~w",
|
||||
[rabbit_misc:rs(QName), Node, Err])
|
||||
end,
|
||||
remove_members(Q, Nodes).
|
||||
|
||||
|
|
|
@ -351,13 +351,13 @@ start_connection(Parent, HelperSups, RanchRef, Deb, Sock) ->
|
|||
ConnName = dynamic_connection_name(Name),
|
||||
ConnDuration = connection_duration(ConnectedAt0),
|
||||
?LOG_INFO("closing AMQP connection (~ts, vhost: '~ts', user: '~ts', duration: '~ts')",
|
||||
[ConnName, VHost, Username, ConnDuration]);
|
||||
[ConnName, VHost, Username, ConnDuration]);
|
||||
%% just to be more defensive
|
||||
_ ->
|
||||
ConnName = dynamic_connection_name(Name),
|
||||
ConnDuration = connection_duration(ConnectedAt),
|
||||
?LOG_INFO("closing AMQP connection (~ts, duration: '~ts')",
|
||||
[ConnName, ConnDuration])
|
||||
[ConnName, ConnDuration])
|
||||
end
|
||||
catch
|
||||
Ex ->
|
||||
|
@ -1376,11 +1376,11 @@ handle_method0(#'connection.update_secret'{new_secret = NewSecret, reason = Reas
|
|||
State#v1{connection = Conn#connection{user = User1}};
|
||||
{refused, Message} ->
|
||||
?LOG_ERROR("Secret update was refused for user '~ts': ~tp",
|
||||
[Username, Message]),
|
||||
[Username, Message]),
|
||||
rabbit_misc:protocol_error(not_allowed, "New secret was refused by one of the backends", []);
|
||||
{error, Message} ->
|
||||
?LOG_ERROR("Secret update for user '~ts' failed: ~tp",
|
||||
[Username, Message]),
|
||||
[Username, Message]),
|
||||
rabbit_misc:protocol_error(not_allowed,
|
||||
"Secret update failed", [])
|
||||
end;
|
||||
|
@ -1842,7 +1842,7 @@ augment_connection_log_name(#connection{name = Name} = Connection) ->
|
|||
UserSpecifiedName ->
|
||||
LogName = <<Name/binary, " - ", UserSpecifiedName/binary>>,
|
||||
?LOG_INFO("connection ~ts has a client-provided name: ~ts",
|
||||
[Name, UserSpecifiedName]),
|
||||
[Name, UserSpecifiedName]),
|
||||
?store_proc_name(LogName),
|
||||
Connection#connection{log_name = LogName}
|
||||
end.
|
||||
|
|
|
@ -38,7 +38,7 @@ start(VHost) ->
|
|||
%% e.g. some integration tests do it
|
||||
{error, {no_such_vhost, VHost}} ->
|
||||
?LOG_ERROR("Failed to start a recovery terms manager for vhost ~ts: vhost no longer exists!",
|
||||
[VHost]),
|
||||
[VHost]),
|
||||
{error, {no_such_vhost, VHost}}
|
||||
end.
|
||||
|
||||
|
@ -54,7 +54,7 @@ stop(VHost) ->
|
|||
%% see start/1
|
||||
{error, {no_such_vhost, VHost}} ->
|
||||
?LOG_ERROR("Failed to stop a recovery terms manager for vhost ~ts: vhost no longer exists!",
|
||||
[VHost]),
|
||||
[VHost]),
|
||||
|
||||
ok
|
||||
end.
|
||||
|
@ -83,7 +83,7 @@ clear(VHost) ->
|
|||
%% see start/1
|
||||
catch _:badarg ->
|
||||
?LOG_ERROR("Failed to clear recovery terms for vhost ~ts: table no longer exists!",
|
||||
[VHost]),
|
||||
[VHost]),
|
||||
ok
|
||||
end,
|
||||
flush(VHost).
|
||||
|
@ -140,7 +140,7 @@ open_table(VHost, RamFile, RetriesLeft) ->
|
|||
%% Wait before retrying
|
||||
DelayInMs = 1000,
|
||||
?LOG_WARNING("Failed to open a recovery terms DETS file at ~tp. Will delete it and retry in ~tp ms (~tp retries left)",
|
||||
[File, DelayInMs, RetriesLeft]),
|
||||
[File, DelayInMs, RetriesLeft]),
|
||||
timer:sleep(DelayInMs),
|
||||
open_table(VHost, RamFile, RetriesLeft - 1)
|
||||
end
|
||||
|
@ -154,7 +154,7 @@ flush(VHost) ->
|
|||
%% see clear/1
|
||||
catch _:badarg ->
|
||||
?LOG_ERROR("Failed to sync recovery terms table for vhost ~ts: the table no longer exists!",
|
||||
[VHost]),
|
||||
[VHost]),
|
||||
ok
|
||||
end.
|
||||
|
||||
|
@ -167,6 +167,6 @@ close_table(VHost) ->
|
|||
%% see clear/1
|
||||
catch _:badarg ->
|
||||
?LOG_ERROR("Failed to close recovery terms table for vhost ~ts: the table no longer exists!",
|
||||
[VHost]),
|
||||
[VHost]),
|
||||
ok
|
||||
end.
|
||||
|
|
|
@ -127,8 +127,8 @@ set_any(VHost, Component, Name, Term, User) ->
|
|||
|
||||
set_any0(VHost, Component, Name, Term, User) ->
|
||||
?LOG_DEBUG("Asked to set or update runtime parameter '~ts' in vhost '~ts' "
|
||||
"for component '~ts', value: ~tp",
|
||||
[Name, VHost, Component, Term]),
|
||||
"for component '~ts', value: ~tp",
|
||||
[Name, VHost, Component, Term]),
|
||||
case lookup_component(Component) of
|
||||
{ok, Mod} ->
|
||||
case is_within_limit(Component) of
|
||||
|
|
|
@ -200,8 +200,8 @@ auth_config_sane() ->
|
|||
case proplists:get_value(verify, Opts) of
|
||||
verify_peer -> true;
|
||||
V -> ?LOG_WARNING("TLS peer verification (authentication) is "
|
||||
"disabled, ssl_options.verify value used: ~tp. "
|
||||
"See https://www.rabbitmq.com/docs/ssl#peer-verification to learn more.", [V]),
|
||||
"disabled, ssl_options.verify value used: ~tp. "
|
||||
"See https://www.rabbitmq.com/docs/ssl#peer-verification to learn more.", [V]),
|
||||
false
|
||||
end.
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ restart_stream(Q, Options)
|
|||
when ?is_amqqueue(Q) andalso
|
||||
?amqqueue_is_stream(Q) ->
|
||||
?LOG_INFO("restarting stream ~s in vhost ~s with options ~p",
|
||||
[maps:get(name, amqqueue:get_type_state(Q)), amqqueue:get_vhost(Q), Options]),
|
||||
[maps:get(name, amqqueue:get_type_state(Q)), amqqueue:get_vhost(Q), Options]),
|
||||
#{name := StreamId} = amqqueue:get_type_state(Q),
|
||||
case process_command({restart_stream, StreamId, Options}) of
|
||||
{ok, {ok, LeaderPid}, _} ->
|
||||
|
@ -219,7 +219,7 @@ add_replica(Q, Node) when ?is_amqqueue(Q) ->
|
|||
false ->
|
||||
Name = rabbit_misc:rs(amqqueue:get_name(Q)),
|
||||
?LOG_INFO("~ts : adding replica ~ts to ~ts Replication State: ~w",
|
||||
[?MODULE, Node, Name, ReplState0]),
|
||||
[?MODULE, Node, Name, ReplState0]),
|
||||
StreamId = maps:get(name, amqqueue:get_type_state(Q)),
|
||||
case process_command({add_replica, StreamId, #{node => Node}}) of
|
||||
{ok, Result, _} ->
|
||||
|
@ -446,7 +446,7 @@ process_command([Server | Servers], Cmd) ->
|
|||
element(1, Cmd)
|
||||
end,
|
||||
?LOG_WARNING("Coordinator timeout on server ~w when processing command ~W",
|
||||
[element(2, Server), CmdLabel, 10]),
|
||||
[element(2, Server), CmdLabel, 10]),
|
||||
process_command(Servers, Cmd);
|
||||
{error, noproc} ->
|
||||
process_command(Servers, Cmd);
|
||||
|
@ -518,8 +518,8 @@ start_coordinator_cluster() ->
|
|||
?MODULE, version, [])],
|
||||
MinVersion = lists:min([version() | Versions]),
|
||||
?LOG_DEBUG("Starting stream coordinator on nodes: ~w, "
|
||||
"initial machine version ~b",
|
||||
[Nodes, MinVersion]),
|
||||
"initial machine version ~b",
|
||||
[Nodes, MinVersion]),
|
||||
case ra:start_cluster(?RA_SYSTEM,
|
||||
[make_ra_conf(Node, Nodes, MinVersion)
|
||||
|| Node <- Nodes]) of
|
||||
|
@ -528,7 +528,7 @@ start_coordinator_cluster() ->
|
|||
Started;
|
||||
{error, cluster_not_formed} ->
|
||||
?LOG_WARNING("Stream coordinator could not be started on nodes ~w",
|
||||
[Nodes]),
|
||||
[Nodes]),
|
||||
[]
|
||||
end.
|
||||
|
||||
|
@ -742,7 +742,7 @@ apply(Meta, {nodeup, Node} = Cmd,
|
|||
single_active_consumer = Sac1}, ok, Effects2);
|
||||
apply(Meta, {machine_version, From, To}, State0) ->
|
||||
?LOG_INFO("Stream coordinator machine version changes from ~tp to ~tp, "
|
||||
++ "applying incremental upgrade.", [From, To]),
|
||||
++ "applying incremental upgrade.", [From, To]),
|
||||
%% RA applies machine upgrades from any version to any version, e.g. 0 -> 2.
|
||||
%% We fill in the gaps here, applying all 1-to-1 machine upgrades.
|
||||
{State1, Effects} = lists:foldl(fun(Version, {S0, Eff0}) ->
|
||||
|
@ -758,7 +758,7 @@ apply(Meta, {timeout, {sac, node_disconnected, #{connection_pid := Pid}}},
|
|||
Effects);
|
||||
apply(Meta, UnkCmd, State) ->
|
||||
?LOG_DEBUG("~ts: unknown command ~W",
|
||||
[?MODULE, UnkCmd, 10]),
|
||||
[?MODULE, UnkCmd, 10]),
|
||||
return(Meta, State, {error, unknown_command}, []).
|
||||
|
||||
return(#{index := Idx}, State, Reply, Effects) ->
|
||||
|
@ -844,8 +844,8 @@ maybe_resize_coordinator_cluster(LeaderPid, SacNodes, MachineVersion) ->
|
|||
%% any remaining members will be added
|
||||
%% next tick
|
||||
?LOG_INFO("~ts: New rabbit node(s) detected, "
|
||||
"adding : ~w",
|
||||
[?MODULE, New]),
|
||||
"adding : ~w",
|
||||
[?MODULE, New]),
|
||||
add_member(Members, New)
|
||||
end,
|
||||
case MemberNodes -- RabbitNodes of
|
||||
|
@ -856,8 +856,8 @@ maybe_resize_coordinator_cluster(LeaderPid, SacNodes, MachineVersion) ->
|
|||
%% coordinator member is now removed as part
|
||||
%% of the forget_cluster_node command
|
||||
?LOG_INFO("~ts: Rabbit node(s) removed "
|
||||
"from the cluster, "
|
||||
"deleting: ~w", [?MODULE, Old]),
|
||||
"from the cluster, "
|
||||
"deleting: ~w", [?MODULE, Old]),
|
||||
_ = remove_member(Leader, Members, Old),
|
||||
ok
|
||||
end,
|
||||
|
@ -876,8 +876,8 @@ maybe_handle_stale_nodes(SacNodes, BrokerNodes,
|
|||
ok;
|
||||
Stale when length(BrokerNodes) > 0 ->
|
||||
?LOG_DEBUG("Stale nodes detected in stream SAC "
|
||||
"coordinator: ~w. Purging state.",
|
||||
[Stale]),
|
||||
"coordinator: ~w. Purging state.",
|
||||
[Stale]),
|
||||
ra:pipeline_command(LeaderPid, sac_make_purge_nodes(Stale)),
|
||||
ok;
|
||||
_ ->
|
||||
|
@ -905,15 +905,15 @@ add_member(Members, Node) ->
|
|||
ok;
|
||||
{error, Err} ->
|
||||
?LOG_WARNING("~ts: Failed to add member, reason ~w"
|
||||
"deleting started server on ~w",
|
||||
[?MODULE, Err, Node]),
|
||||
"deleting started server on ~w",
|
||||
[?MODULE, Err, Node]),
|
||||
case ra:force_delete_server(?RA_SYSTEM, ServerId) of
|
||||
ok ->
|
||||
ok;
|
||||
Err ->
|
||||
?LOG_WARNING("~ts: Failed to delete server "
|
||||
"on ~w, reason ~w",
|
||||
[?MODULE, Node, Err]),
|
||||
"on ~w, reason ~w",
|
||||
[?MODULE, Node, Err]),
|
||||
ok
|
||||
end
|
||||
end;
|
||||
|
@ -936,14 +936,14 @@ add_member(Members, Node) ->
|
|||
ok;
|
||||
Err ->
|
||||
?LOG_WARNING("~ts: Failed to delete server "
|
||||
"on ~w, reason ~w",
|
||||
[?MODULE, Node, Err]),
|
||||
"on ~w, reason ~w",
|
||||
[?MODULE, Node, Err]),
|
||||
ok
|
||||
end
|
||||
end;
|
||||
Error ->
|
||||
?LOG_WARNING("Stream coordinator server failed to start on node ~ts : ~W",
|
||||
[Node, Error, 10]),
|
||||
[Node, Error, 10]),
|
||||
ok
|
||||
end.
|
||||
|
||||
|
@ -985,42 +985,42 @@ handle_aux(leader, _, {start_writer, StreamId,
|
|||
#{epoch := Epoch, node := Node} = Args, Conf},
|
||||
Aux, RaAux) ->
|
||||
?LOG_DEBUG("~ts: running action: 'start_writer'"
|
||||
" for ~ts on node ~w in epoch ~b",
|
||||
[?MODULE, StreamId, Node, Epoch]),
|
||||
" for ~ts on node ~w in epoch ~b",
|
||||
[?MODULE, StreamId, Node, Epoch]),
|
||||
ActionFun = phase_start_writer(StreamId, Args, Conf),
|
||||
run_action(starting, StreamId, Args, ActionFun, Aux, RaAux);
|
||||
handle_aux(leader, _, {start_replica, StreamId,
|
||||
#{epoch := Epoch, node := Node} = Args, Conf},
|
||||
Aux, RaAux) ->
|
||||
?LOG_DEBUG("~ts: running action: 'start_replica'"
|
||||
" for ~ts on node ~w in epoch ~b",
|
||||
[?MODULE, StreamId, Node, Epoch]),
|
||||
" for ~ts on node ~w in epoch ~b",
|
||||
[?MODULE, StreamId, Node, Epoch]),
|
||||
ActionFun = phase_start_replica(StreamId, Args, Conf),
|
||||
run_action(starting, StreamId, Args, ActionFun, Aux, RaAux);
|
||||
handle_aux(leader, _, {stop, StreamId, #{node := Node,
|
||||
epoch := Epoch} = Args, Conf},
|
||||
Aux, RaAux) ->
|
||||
?LOG_DEBUG("~ts: running action: 'stop'"
|
||||
" for ~ts on node ~w in epoch ~b",
|
||||
[?MODULE, StreamId, Node, Epoch]),
|
||||
" for ~ts on node ~w in epoch ~b",
|
||||
[?MODULE, StreamId, Node, Epoch]),
|
||||
ActionFun = phase_stop_member(StreamId, Args, Conf),
|
||||
run_action(stopping, StreamId, Args, ActionFun, Aux, RaAux);
|
||||
handle_aux(leader, _, {update_mnesia, StreamId, Args, Conf},
|
||||
#aux{actions = _Monitors} = Aux, RaAux) ->
|
||||
?LOG_DEBUG("~ts: running action: 'update_mnesia'"
|
||||
" for ~ts", [?MODULE, StreamId]),
|
||||
" for ~ts", [?MODULE, StreamId]),
|
||||
ActionFun = phase_update_mnesia(StreamId, Args, Conf),
|
||||
run_action(updating_mnesia, StreamId, Args, ActionFun, Aux, RaAux);
|
||||
handle_aux(leader, _, {update_retention, StreamId, Args, _Conf},
|
||||
#aux{actions = _Monitors} = Aux, RaAux) ->
|
||||
?LOG_DEBUG("~ts: running action: 'update_retention'"
|
||||
" for ~ts", [?MODULE, StreamId]),
|
||||
" for ~ts", [?MODULE, StreamId]),
|
||||
ActionFun = phase_update_retention(StreamId, Args),
|
||||
run_action(update_retention, StreamId, Args, ActionFun, Aux, RaAux);
|
||||
handle_aux(leader, _, {delete_member, StreamId, #{node := Node} = Args, Conf},
|
||||
#aux{actions = _Monitors} = Aux, RaAux) ->
|
||||
?LOG_DEBUG("~ts: running action: 'delete_member'"
|
||||
" for ~ts ~ts", [?MODULE, StreamId, Node]),
|
||||
" for ~ts ~ts", [?MODULE, StreamId, Node]),
|
||||
ActionFun = phase_delete_member(StreamId, Args, Conf),
|
||||
run_action(delete_member, StreamId, Args, ActionFun, Aux, RaAux);
|
||||
handle_aux(leader, _, fail_active_actions,
|
||||
|
@ -1045,8 +1045,8 @@ handle_aux(leader, _, {down, Pid, Reason},
|
|||
case maps:get(Pid, Monitors0, undefined) of
|
||||
{StreamId, Action, #{node := Node, epoch := Epoch} = Args} ->
|
||||
?LOG_WARNING("~ts: error while executing action ~w for stream queue ~ts, "
|
||||
" node ~ts, epoch ~b Err: ~w",
|
||||
[?MODULE, Action, StreamId, Node, Epoch, Reason]),
|
||||
" node ~ts, epoch ~b Err: ~w",
|
||||
[?MODULE, Action, StreamId, Node, Epoch, Reason]),
|
||||
Monitors = maps:remove(Pid, Monitors0),
|
||||
Cmd = {action_failed, StreamId, Args#{action => Action}},
|
||||
send_self_command(Cmd),
|
||||
|
@ -1112,7 +1112,7 @@ phase_start_replica(StreamId, #{epoch := Epoch,
|
|||
try osiris_replica:start(Node, Conf0) of
|
||||
{ok, Pid} ->
|
||||
?LOG_INFO("~ts: ~ts: replica started on ~ts in ~b pid ~w",
|
||||
[?MODULE, StreamId, Node, Epoch, Pid]),
|
||||
[?MODULE, StreamId, Node, Epoch, Pid]),
|
||||
send_self_command({member_started, StreamId,
|
||||
Args#{pid => Pid}});
|
||||
{error, already_present} ->
|
||||
|
@ -1128,12 +1128,12 @@ phase_start_replica(StreamId, #{epoch := Epoch,
|
|||
Args#{pid => Pid}});
|
||||
{error, Reason} ->
|
||||
?LOG_WARNING("~ts: Error while starting replica for ~ts on node ~ts in ~b : ~W",
|
||||
[?MODULE, maps:get(name, Conf0), Node, Epoch, Reason, 10]),
|
||||
[?MODULE, maps:get(name, Conf0), Node, Epoch, Reason, 10]),
|
||||
maybe_sleep(Reason),
|
||||
send_action_failed(StreamId, starting, Args)
|
||||
catch _:Error ->
|
||||
?LOG_WARNING("~ts: Error while starting replica for ~ts on node ~ts in ~b : ~W",
|
||||
[?MODULE, maps:get(name, Conf0), Node, Epoch, Error, 10]),
|
||||
[?MODULE, maps:get(name, Conf0), Node, Epoch, Error, 10]),
|
||||
maybe_sleep(Error),
|
||||
send_action_failed(StreamId, starting, Args)
|
||||
end
|
||||
|
@ -1154,13 +1154,13 @@ phase_delete_member(StreamId, #{node := Node} = Arg, Conf) ->
|
|||
try osiris:delete_member(Node, Conf) of
|
||||
ok ->
|
||||
?LOG_INFO("~ts: Member deleted for ~ts : on node ~ts",
|
||||
[?MODULE, StreamId, Node]),
|
||||
[?MODULE, StreamId, Node]),
|
||||
send_self_command({member_deleted, StreamId, Arg});
|
||||
_ ->
|
||||
send_action_failed(StreamId, deleting, Arg)
|
||||
catch _:E ->
|
||||
?LOG_WARNING("~ts: Error while deleting member for ~ts : on node ~ts ~W",
|
||||
[?MODULE, StreamId, Node, E, 10]),
|
||||
[?MODULE, StreamId, Node, E, 10]),
|
||||
maybe_sleep(E),
|
||||
send_action_failed(StreamId, deleting, Arg)
|
||||
end;
|
||||
|
@ -1168,7 +1168,7 @@ phase_delete_member(StreamId, #{node := Node} = Arg, Conf) ->
|
|||
%% node is no longer a cluster member, we return success to avoid
|
||||
%% trying to delete the member indefinitely
|
||||
?LOG_INFO("~ts: Member deleted/forgotten for ~ts : node ~ts is no longer a cluster member",
|
||||
[?MODULE, StreamId, Node]),
|
||||
[?MODULE, StreamId, Node]),
|
||||
send_self_command({member_deleted, StreamId, Arg})
|
||||
end
|
||||
end.
|
||||
|
@ -1182,22 +1182,22 @@ phase_stop_member(StreamId, #{node := Node, epoch := Epoch} = Arg0, Conf) ->
|
|||
{ok, Tail} ->
|
||||
Arg = Arg0#{tail => Tail},
|
||||
?LOG_DEBUG("~ts: ~ts: member stopped on ~ts in ~b Tail ~w",
|
||||
[?MODULE, StreamId, Node, Epoch, Tail]),
|
||||
[?MODULE, StreamId, Node, Epoch, Tail]),
|
||||
send_self_command({member_stopped, StreamId, Arg});
|
||||
Err ->
|
||||
?LOG_WARNING("~ts: failed to get tail of member ~ts on ~ts in ~b Error: ~w",
|
||||
[?MODULE, StreamId, Node, Epoch, Err]),
|
||||
[?MODULE, StreamId, Node, Epoch, Err]),
|
||||
maybe_sleep(Err),
|
||||
send_action_failed(StreamId, stopping, Arg0)
|
||||
catch _:Err ->
|
||||
?LOG_WARNING("~ts: failed to get tail of member ~ts on ~ts in ~b Error: ~w",
|
||||
[?MODULE, StreamId, Node, Epoch, Err]),
|
||||
[?MODULE, StreamId, Node, Epoch, Err]),
|
||||
maybe_sleep(Err),
|
||||
send_action_failed(StreamId, stopping, Arg0)
|
||||
end
|
||||
catch _:Err ->
|
||||
?LOG_WARNING("~ts: failed to stop member ~ts ~w Error: ~w",
|
||||
[?MODULE, StreamId, Node, Err]),
|
||||
[?MODULE, StreamId, Node, Err]),
|
||||
maybe_sleep(Err),
|
||||
send_action_failed(StreamId, stopping, Arg0)
|
||||
end
|
||||
|
@ -1209,17 +1209,17 @@ phase_start_writer(StreamId, #{epoch := Epoch, node := Node} = Args0, Conf) ->
|
|||
{ok, Pid} ->
|
||||
Args = Args0#{epoch => Epoch, pid => Pid},
|
||||
?LOG_INFO("~ts: started writer ~ts on ~w in ~b",
|
||||
[?MODULE, StreamId, Node, Epoch]),
|
||||
[?MODULE, StreamId, Node, Epoch]),
|
||||
send_self_command({member_started, StreamId, Args});
|
||||
Err ->
|
||||
%% no sleep for writer failures as we want to trigger a new
|
||||
%% election asap
|
||||
?LOG_WARNING("~ts: failed to start writer ~ts on ~ts in ~b Error: ~w",
|
||||
[?MODULE, StreamId, Node, Epoch, Err]),
|
||||
[?MODULE, StreamId, Node, Epoch, Err]),
|
||||
send_action_failed(StreamId, starting, Args0)
|
||||
catch _:Err ->
|
||||
?LOG_WARNING("~ts: failed to start writer ~ts on ~ts in ~b Error: ~w",
|
||||
[?MODULE, StreamId, Node, Epoch, Err]),
|
||||
[?MODULE, StreamId, Node, Epoch, Err]),
|
||||
send_action_failed(StreamId, starting, Args0)
|
||||
end
|
||||
end.
|
||||
|
@ -1232,12 +1232,12 @@ phase_update_retention(StreamId, #{pid := Pid,
|
|||
send_self_command({retention_updated, StreamId, Args});
|
||||
{error, Reason} = Err ->
|
||||
?LOG_WARNING("~ts: failed to update retention for ~ts ~w Reason: ~w",
|
||||
[?MODULE, StreamId, node(Pid), Reason]),
|
||||
[?MODULE, StreamId, node(Pid), Reason]),
|
||||
maybe_sleep(Err),
|
||||
send_action_failed(StreamId, update_retention, Args)
|
||||
catch _:Err ->
|
||||
?LOG_WARNING("~ts: failed to update retention for ~ts ~w Error: ~w",
|
||||
[?MODULE, StreamId, node(Pid), Err]),
|
||||
[?MODULE, StreamId, node(Pid), Err]),
|
||||
maybe_sleep(Err),
|
||||
send_action_failed(StreamId, update_retention, Args)
|
||||
end
|
||||
|
@ -1283,7 +1283,7 @@ phase_update_mnesia(StreamId, Args, #{reference := QName,
|
|||
leader_pid := LeaderPid} = Conf) ->
|
||||
fun() ->
|
||||
?LOG_DEBUG("~ts: running mnesia update for ~ts: ~W",
|
||||
[?MODULE, StreamId, Conf, 10]),
|
||||
[?MODULE, StreamId, Conf, 10]),
|
||||
Fun = fun (Q) ->
|
||||
case amqqueue:get_type_state(Q) of
|
||||
#{name := S} when S == StreamId ->
|
||||
|
@ -1295,7 +1295,7 @@ phase_update_mnesia(StreamId, Args, #{reference := QName,
|
|||
S = maps:get(name, Ts, undefined),
|
||||
%% TODO log as side-effect
|
||||
?LOG_DEBUG("~ts: refusing mnesia update for stale stream id ~s, current ~s",
|
||||
[?MODULE, StreamId, S]),
|
||||
[?MODULE, StreamId, S]),
|
||||
%% if the stream id isn't a match this is a stale
|
||||
%% update from a previous stream incarnation for the
|
||||
%% same queue name and we ignore it
|
||||
|
@ -1305,8 +1305,8 @@ phase_update_mnesia(StreamId, Args, #{reference := QName,
|
|||
try rabbit_amqqueue:update(QName, Fun) of
|
||||
not_found ->
|
||||
?LOG_DEBUG("~ts: resource for stream id ~ts not found, "
|
||||
"recovering from rabbit_durable_queue",
|
||||
[?MODULE, StreamId]),
|
||||
"recovering from rabbit_durable_queue",
|
||||
[?MODULE, StreamId]),
|
||||
%% This can happen during recovery
|
||||
%% we need to re-initialise the queue record
|
||||
%% if the stream id is a match
|
||||
|
@ -1318,7 +1318,7 @@ phase_update_mnesia(StreamId, Args, #{reference := QName,
|
|||
case amqqueue:get_type_state(Q) of
|
||||
#{name := S} when S == StreamId ->
|
||||
?LOG_DEBUG("~ts: initializing queue record for stream id ~ts",
|
||||
[?MODULE, StreamId]),
|
||||
[?MODULE, StreamId]),
|
||||
ok = rabbit_amqqueue:ensure_rabbit_queue_record_is_initialized(Fun(Q)),
|
||||
ok;
|
||||
_ ->
|
||||
|
@ -1330,7 +1330,7 @@ phase_update_mnesia(StreamId, Args, #{reference := QName,
|
|||
send_self_command({mnesia_updated, StreamId, Args})
|
||||
catch _:E ->
|
||||
?LOG_DEBUG("~ts: failed to update mnesia for ~ts: ~W",
|
||||
[?MODULE, StreamId, E, 10]),
|
||||
[?MODULE, StreamId, E, 10]),
|
||||
send_action_failed(StreamId, updating_mnesia, Args)
|
||||
end
|
||||
end.
|
||||
|
@ -1497,7 +1497,7 @@ update_stream0(#{system_time := _Ts},
|
|||
%% do we just ignore any members started events from unexpected
|
||||
%% epochs?
|
||||
?LOG_WARNING("~ts: member started unexpected ~w ~w",
|
||||
[?MODULE, Args, Member]),
|
||||
[?MODULE, Args, Member]),
|
||||
Stream0
|
||||
end;
|
||||
update_stream0(#{system_time := _Ts},
|
||||
|
@ -2058,8 +2058,8 @@ fail_active_actions(Streams, Exclude) ->
|
|||
case Mnesia of
|
||||
{updating, E} ->
|
||||
?LOG_DEBUG("~ts: failing stale action to trigger retry. "
|
||||
"Stream ID: ~ts, node: ~w, action: ~w",
|
||||
[?MODULE, Id, node(), updating_mnesia]),
|
||||
"Stream ID: ~ts, node: ~w, action: ~w",
|
||||
[?MODULE, Id, node(), updating_mnesia]),
|
||||
send_self_command({action_failed, Id,
|
||||
#{action => updating_mnesia,
|
||||
index => 0,
|
||||
|
@ -2078,8 +2078,8 @@ fail_action(_StreamId, _, #member{current = undefined}) ->
|
|||
fail_action(StreamId, Node, #member{role = {_, E},
|
||||
current = {Action, Idx}}) ->
|
||||
?LOG_DEBUG("~ts: failing stale action to trigger retry. "
|
||||
"Stream ID: ~ts, node: ~w, action: ~w",
|
||||
[?MODULE, StreamId, node(), Action]),
|
||||
"Stream ID: ~ts, node: ~w, action: ~w",
|
||||
[?MODULE, StreamId, node(), Action]),
|
||||
%% if we have an action send failure message
|
||||
send_self_command({action_failed, StreamId,
|
||||
#{action => Action,
|
||||
|
@ -2275,7 +2275,7 @@ machine_version(1, 2, State = #?MODULE{streams = Streams0,
|
|||
listeners = undefined}, Effects};
|
||||
machine_version(2, 3, State) ->
|
||||
?LOG_INFO("Stream coordinator machine version changes from 2 to 3, "
|
||||
"updating state."),
|
||||
"updating state."),
|
||||
SacState = rabbit_stream_sac_coordinator_v4:init_state(),
|
||||
{State#?MODULE{single_active_consumer = SacState},
|
||||
[]};
|
||||
|
@ -2298,7 +2298,7 @@ machine_version(4 = From, 5, #?MODULE{single_active_consumer = Sac0} = State) ->
|
|||
{State#?MODULE{single_active_consumer = Sac1}, []};
|
||||
machine_version(From, To, State) ->
|
||||
?LOG_INFO("Stream coordinator machine version changes from ~tp to ~tp, no state changes required.",
|
||||
[From, To]),
|
||||
[From, To]),
|
||||
{State, []}.
|
||||
|
||||
-spec transfer_leadership([node()]) -> {ok, in_progress | undefined | node()} | {error, any()}.
|
||||
|
|
|
@ -650,8 +650,8 @@ handle_event(_QName, {stream_local_member_change, Pid},
|
|||
osiris_log:close(Log0),
|
||||
CounterSpec = {{?MODULE, QName, self()}, []},
|
||||
?LOG_DEBUG("Re-creating Osiris reader for consumer ~tp at offset ~tp "
|
||||
" with options ~tp",
|
||||
[T, Offset, Options]),
|
||||
" with options ~tp",
|
||||
[T, Offset, Options]),
|
||||
{ok, Log1} = osiris:init_reader(Pid, Offset, CounterSpec, Options),
|
||||
NextOffset = osiris_log:next_offset(Log1) - 1,
|
||||
?LOG_DEBUG("Registering offset listener at offset ~tp", [NextOffset]),
|
||||
|
@ -1002,7 +1002,7 @@ init(Q) when ?is_amqqueue(Q) ->
|
|||
{error, stream_not_found};
|
||||
{error, coordinator_unavailable} = E ->
|
||||
?LOG_WARNING("Failed to start stream client ~tp: coordinator unavailable",
|
||||
[rabbit_misc:rs(QName)]),
|
||||
[rabbit_misc:rs(QName)]),
|
||||
E
|
||||
end.
|
||||
|
||||
|
@ -1086,7 +1086,7 @@ delete_all_replicas(Node) ->
|
|||
lists:map(fun(Q) ->
|
||||
QName = amqqueue:get_name(Q),
|
||||
?LOG_INFO("~ts: removing replica on node ~w",
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
[rabbit_misc:rs(QName), Node]),
|
||||
#{name := StreamId} = amqqueue:get_type_state(Q),
|
||||
{ok, Reply, _} = rabbit_stream_coordinator:delete_replica(StreamId, Node),
|
||||
case Reply of
|
||||
|
@ -1094,7 +1094,7 @@ delete_all_replicas(Node) ->
|
|||
{QName, ok};
|
||||
Err ->
|
||||
?LOG_WARNING("~ts: failed to remove replica on node ~w, error: ~w",
|
||||
[rabbit_misc:rs(QName), Node, Err]),
|
||||
[rabbit_misc:rs(QName), Node, Err]),
|
||||
{QName, {error, Err}}
|
||||
end
|
||||
end, Streams).
|
||||
|
@ -1366,7 +1366,7 @@ resend_all(#stream_client{leader = LeaderPid,
|
|||
[] -> ok;
|
||||
[{Seq, _} | _] ->
|
||||
?LOG_DEBUG("stream client: resending from seq ~w num ~b",
|
||||
[Seq, maps:size(Corrs)])
|
||||
[Seq, maps:size(Corrs)])
|
||||
end,
|
||||
[begin
|
||||
ok = osiris:write(LeaderPid, WriterId, Seq, stream_message(Msg))
|
||||
|
@ -1445,7 +1445,7 @@ revive() ->
|
|||
-spec transfer_leadership_of_stream_coordinator([node()]) -> ok.
|
||||
transfer_leadership_of_stream_coordinator([]) ->
|
||||
?LOG_WARNING("Skipping leadership transfer of stream coordinator: no candidate "
|
||||
"(online, not under maintenance) nodes to transfer to!");
|
||||
"(online, not under maintenance) nodes to transfer to!");
|
||||
transfer_leadership_of_stream_coordinator(TransferCandidates) ->
|
||||
% try to transfer to the node with the lowest uptime; the assumption is that
|
||||
% nodes are usually restarted in a rolling fashion, in a consistent order;
|
||||
|
|
|
@ -288,8 +288,8 @@ apply(#command_activate_consumer{vhost = VH, stream = S, consumer_name = Name},
|
|||
case lookup_group(VH, S, Name, StreamGroups0) of
|
||||
undefined ->
|
||||
?LOG_WARNING("Trying to activate consumer in group ~tp, but "
|
||||
"the group does not longer exist",
|
||||
[{VH, S, Name}]),
|
||||
"the group does not longer exist",
|
||||
[{VH, S, Name}]),
|
||||
{undefined, []};
|
||||
G0 ->
|
||||
%% keep track of the former active, if any
|
||||
|
@ -756,7 +756,7 @@ handle_connection_node_disconnected(ConnPid,
|
|||
T = disconnected_timeout(State2),
|
||||
{State2, [node_disconnected_timer_effect(ConnPid, T)]}
|
||||
end.
|
||||
|
||||
|
||||
-spec handle_node_reconnected(node(), state(), ra_machine:effects()) ->
|
||||
{state(), ra_machine:effects()}.
|
||||
handle_node_reconnected(Node,
|
||||
|
|
|
@ -253,8 +253,8 @@ apply(#command_activate_consumer{vhost = VirtualHost,
|
|||
case lookup_group(VirtualHost, Stream, ConsumerName, StreamGroups0) of
|
||||
undefined ->
|
||||
?LOG_WARNING("Trying to activate consumer in group ~tp, but "
|
||||
"the group does not longer exist",
|
||||
[{VirtualHost, Stream, ConsumerName}]),
|
||||
"the group does not longer exist",
|
||||
[{VirtualHost, Stream, ConsumerName}]),
|
||||
{undefined, []};
|
||||
Group ->
|
||||
#consumer{pid = Pid, subscription_id = SubId} =
|
||||
|
@ -473,7 +473,7 @@ pids_groups_to_map(PidsGroups) when is_map(PidsGroups) ->
|
|||
|
||||
group_to_map(#group{consumers = Consumers, partition_index = Index}) ->
|
||||
OutConsumers = lists:foldl(fun(C, Acc) ->
|
||||
Acc ++ [consumer_to_map(C)]
|
||||
Acc ++ [consumer_to_map(C)]
|
||||
end, [], Consumers),
|
||||
#{<<"consumers">> => OutConsumers, <<"partition_index">> => Index}.
|
||||
|
||||
|
|
|
@ -130,8 +130,8 @@ update_config(Fun) ->
|
|||
Sessions = rabbit_amqp_session:list_local(),
|
||||
NonAmqpPids = rabbit_networking:local_non_amqp_connections(),
|
||||
?LOG_DEBUG("Refreshing state of channels, ~b sessions and ~b non "
|
||||
"AMQP 0.9.1 connections after virtual host tracing changes...",
|
||||
[length(Sessions), length(NonAmqpPids)]),
|
||||
"AMQP 0.9.1 connections after virtual host tracing changes...",
|
||||
[length(Sessions), length(NonAmqpPids)]),
|
||||
Pids = Sessions ++ NonAmqpPids,
|
||||
lists:foreach(fun(Pid) -> gen_server:cast(Pid, refresh_config) end, Pids),
|
||||
{Time, ok} = timer:tc(fun rabbit_channel:refresh_config_local/0),
|
||||
|
|
|
@ -68,12 +68,12 @@ do_await_safe_online_quorum(IterationsLeft) ->
|
|||
case length(EndangeredQueues) of
|
||||
0 -> ok;
|
||||
N -> ?LOG_INFO("Waiting for ~p queues and streams to have quorum+1 replicas online. "
|
||||
"You can list them with `rabbitmq-diagnostics check_if_node_is_quorum_critical`", [N])
|
||||
"You can list them with `rabbitmq-diagnostics check_if_node_is_quorum_critical`", [N])
|
||||
end,
|
||||
case endangered_critical_components() of
|
||||
[] -> ok;
|
||||
_ -> ?LOG_INFO("Waiting for the following critical components to have quorum+1 replicas online: ~p.",
|
||||
[endangered_critical_components()])
|
||||
[endangered_critical_components()])
|
||||
end;
|
||||
_ ->
|
||||
ok
|
||||
|
|
|
@ -394,11 +394,11 @@ do_start_msg_store(VHost, Type, Refs, StartFunState) ->
|
|||
?LOG_INFO("Started message store of type ~ts for vhost '~ts'", [abbreviated_type(Type), VHost]);
|
||||
{error, {no_such_vhost, VHost}} = Err ->
|
||||
?LOG_ERROR("Failed to start message store of type ~ts for vhost '~ts': the vhost no longer exists!",
|
||||
[Type, VHost]),
|
||||
[Type, VHost]),
|
||||
exit(Err);
|
||||
{error, Error} ->
|
||||
?LOG_ERROR("Failed to start message store of type ~ts for vhost '~ts': ~tp",
|
||||
[Type, VHost, Error]),
|
||||
[Type, VHost, Error]),
|
||||
exit({error, Error})
|
||||
end.
|
||||
|
||||
|
@ -893,7 +893,7 @@ convert_from_v1_to_v2_loop(QueueName, V1Index0, V2Index0, V2Store0,
|
|||
%% embedded messages can take quite some time.
|
||||
#resource{virtual_host = VHost, name = Name} = QueueName,
|
||||
?LOG_INFO("Queue ~ts in vhost ~ts converted ~b messages from v1 to v2",
|
||||
[Name, VHost, length(Messages)]),
|
||||
[Name, VHost, length(Messages)]),
|
||||
convert_from_v1_to_v2_loop(QueueName, V1Index, V2Index, V2Store, Counters, UpSeqId, HiSeqId, SkipFun).
|
||||
|
||||
%% Get the Timestamp property of the first msg, if present. This is
|
||||
|
|
|
@ -78,14 +78,14 @@ recover(VHost) ->
|
|||
false ->
|
||||
DefaultType = rabbit_queue_type:default_alias(),
|
||||
?LOG_INFO("Setting missing default queue type to '~p' for vhost '~ts'.",
|
||||
[DefaultType, VHost]),
|
||||
[DefaultType, VHost]),
|
||||
case rabbit_db_vhost:merge_metadata(VHost, #{default_queue_type => DefaultType}) of
|
||||
{ok, _UpdatedVHostRecord} ->
|
||||
ok;
|
||||
{error, Reason} ->
|
||||
% Log the error but continue recovery
|
||||
?LOG_WARNING("Failed to set the default queue type for vhost '~ts': ~p",
|
||||
[VHost, Reason])
|
||||
[VHost, Reason])
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
@ -126,7 +126,7 @@ ensure_config_file(VHost) ->
|
|||
?LEGACY_INDEX_SEGMENT_ENTRY_COUNT
|
||||
end,
|
||||
?LOG_INFO("Setting segment_entry_count for vhost '~ts' with ~b queues to '~b'",
|
||||
[VHost, length(QueueDirs), SegmentEntryCount]),
|
||||
[VHost, length(QueueDirs), SegmentEntryCount]),
|
||||
file:write_file(Path, io_lib:format(
|
||||
"%% This file is auto-generated! Edit at your own risk!~n"
|
||||
"{segment_entry_count, ~b}.",
|
||||
|
@ -208,7 +208,7 @@ do_add(Name, Metadata0, ActingUser) ->
|
|||
#{default_queue_type := DQT} ->
|
||||
%% check that the queue type is known
|
||||
?LOG_DEBUG("Default queue type of virtual host '~ts' is ~tp",
|
||||
[Name, DQT]),
|
||||
[Name, DQT]),
|
||||
try rabbit_queue_type:discover(DQT) of
|
||||
QueueType when is_atom(QueueType) ->
|
||||
case rabbit_queue_type:is_enabled(QueueType) of
|
||||
|
@ -229,7 +229,7 @@ do_add(Name, Metadata0, ActingUser) ->
|
|||
?LOG_INFO("Adding vhost '~ts' without a description", [Name]);
|
||||
Description ->
|
||||
?LOG_INFO("Adding vhost '~ts' (description: '~ts', tags: ~tp)",
|
||||
[Name, Description, Tags])
|
||||
[Name, Description, Tags])
|
||||
end,
|
||||
DefaultLimits = rabbit_db_vhost_defaults:list_limits(Name),
|
||||
|
||||
|
|
|
@ -49,8 +49,8 @@ init([VHost]) ->
|
|||
catch _:Reason:Stacktrace ->
|
||||
rabbit_amqqueue:mark_local_durable_queues_stopped(VHost),
|
||||
?LOG_ERROR("Unable to recover vhost ~tp data. Reason ~tp~n"
|
||||
" Stacktrace ~tp",
|
||||
[VHost, Reason, Stacktrace]),
|
||||
" Stacktrace ~tp",
|
||||
[VHost, Reason, Stacktrace]),
|
||||
{stop, Reason}
|
||||
end.
|
||||
|
||||
|
@ -65,8 +65,8 @@ handle_info(check_vhost, VHost) ->
|
|||
true -> {noreply, VHost};
|
||||
false ->
|
||||
?LOG_WARNING("Virtual host '~ts' is gone. "
|
||||
"Stopping its top level supervisor.",
|
||||
[VHost]),
|
||||
"Stopping its top level supervisor.",
|
||||
[VHost]),
|
||||
%% Stop vhost's top supervisor in a one-off process to avoid a deadlock:
|
||||
%% us (a child process) waiting for supervisor shutdown and our supervisor(s)
|
||||
%% waiting for us to shutdown.
|
||||
|
|
|
@ -92,8 +92,8 @@ stop_and_delete_vhost(VHost) ->
|
|||
ok;
|
||||
true ->
|
||||
?LOG_INFO("Stopping vhost supervisor ~tp"
|
||||
" for vhost '~ts'",
|
||||
[VHostSupPid, VHost]),
|
||||
" for vhost '~ts'",
|
||||
[VHostSupPid, VHost]),
|
||||
case supervisor:terminate_child(?MODULE, WrapperPid) of
|
||||
ok ->
|
||||
true = ets:delete(?MODULE, VHost),
|
||||
|
@ -114,9 +114,9 @@ stop_and_delete_vhost(VHost, Node) ->
|
|||
ok -> ok;
|
||||
{badrpc, RpcErr} ->
|
||||
?LOG_ERROR("Failed to stop and delete a vhost ~tp"
|
||||
" on node ~tp."
|
||||
" Reason: ~tp",
|
||||
[VHost, Node, RpcErr]),
|
||||
" on node ~tp."
|
||||
" Reason: ~tp",
|
||||
[VHost, Node, RpcErr]),
|
||||
{error, RpcErr}
|
||||
end.
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ terminate(_Reason, #state{on_shutdown = OnShutdown, label = Label, ip = IPAddres
|
|||
OnShutdown(IPAddress, Port)
|
||||
catch _:Error ->
|
||||
?LOG_ERROR("Failed to stop ~ts on ~ts:~tp: ~tp",
|
||||
[Label, rabbit_misc:ntoab(IPAddress), Port, Error])
|
||||
[Label, rabbit_misc:ntoab(IPAddress), Port, Error])
|
||||
end.
|
||||
|
||||
code_change(_OldVsn, State, _Extra) ->
|
||||
|
|
|
@ -222,7 +222,7 @@ prop_common(InitialState) ->
|
|||
{History, State, Result} = run_commands(?MODULE, Commands),
|
||||
cmd_teardown_queue(State),
|
||||
?WHENFAIL(?LOG_ERROR("History: ~tp~nState: ~tp~nResult: ~tp",
|
||||
[History, State, Result]),
|
||||
[History, State, Result]),
|
||||
aggregate(command_names(Commands), Result =:= ok))
|
||||
end)
|
||||
).
|
||||
|
|
|
@ -18,11 +18,11 @@ amqp_params(ConnPid, Timeout) ->
|
|||
gen_server:call(ConnPid, {info, [amqp_params]}, Timeout)
|
||||
catch exit:{noproc, Error} ->
|
||||
?LOG_DEBUG("file ~tp, line ~tp - connection process ~tp not alive: ~tp",
|
||||
[?FILE, ?LINE, ConnPid, Error]),
|
||||
[?FILE, ?LINE, ConnPid, Error]),
|
||||
[];
|
||||
_:Error ->
|
||||
?LOG_DEBUG("file ~tp, line ~tp - failed to get amqp_params from connection process ~tp: ~tp",
|
||||
[?FILE, ?LINE, ConnPid, Error]),
|
||||
[?FILE, ?LINE, ConnPid, Error]),
|
||||
[]
|
||||
end,
|
||||
process_amqp_params_result(P).
|
||||
|
|
|
@ -1725,7 +1725,7 @@ collect_conf_env_file_output(Context, Port, Marker, Output) ->
|
|||
Context, Port, Marker, [Output, UnicodeChunk]);
|
||||
{Port, {data, Chunk}} ->
|
||||
?LOG_WARNING("~tp unexpected non-binary chunk in "
|
||||
"conf env file output: ~tp~n", [?MODULE, Chunk])
|
||||
"conf env file output: ~tp~n", [?MODULE, Chunk])
|
||||
end.
|
||||
|
||||
post_port_cmd_output(#{os_type := {OSType, _}}, UnicodeOutput, ExitStatus) ->
|
||||
|
@ -2158,4 +2158,4 @@ unicode_characters_to_list(Input) ->
|
|||
|
||||
log_characters_to_list_error(Input, Partial, Rest) ->
|
||||
?LOG_ERROR("error converting '~tp' to unicode string "
|
||||
"(partial '~tp', rest '~tp')", [Input, Partial, Rest]).
|
||||
"(partial '~tp', rest '~tp')", [Input, Partial, Rest]).
|
||||
|
|
|
@ -787,8 +787,8 @@ get_expected_env_str(Key, Default) ->
|
|||
V = case env(Key) of
|
||||
Default ->
|
||||
?LOG_WARNING("rabbitmq_auth_backend_ldap configuration key '~tp' is set to "
|
||||
"the default value of '~tp', expected to get a non-default value",
|
||||
[Key, Default]),
|
||||
"the default value of '~tp', expected to get a non-default value",
|
||||
[Key, Default]),
|
||||
Default;
|
||||
V0 ->
|
||||
V0
|
||||
|
|
|
@ -56,6 +56,6 @@ parse_pattern(Pattern) ->
|
|||
try lists:map(fun(Part) -> cow_qs:urldecode(Part) end, Parts)
|
||||
catch Type:Error ->
|
||||
?LOG_WARNING("Invalid pattern ~tp : ~tp",
|
||||
[Pattern, {Type, Error}]),
|
||||
[Pattern, {Type, Error}]),
|
||||
invalid
|
||||
end.
|
||||
|
|
|
@ -186,8 +186,8 @@ delete_bindings_in_mnesia(Bindings, DeleteFun) ->
|
|||
|
||||
delete_binding_in_mnesia(#binding{source = S, destination = D, key = RK}, DeleteFun) ->
|
||||
?LOG_DEBUG("Consistent hashing exchange: removing binding "
|
||||
"from exchange ~ts to destination ~ts with routing key '~ts'",
|
||||
[rabbit_misc:rs(S), rabbit_misc:rs(D), RK]),
|
||||
"from exchange ~ts to destination ~ts with routing key '~ts'",
|
||||
[rabbit_misc:rs(S), rabbit_misc:rs(D), RK]),
|
||||
case mnesia:read(?HASH_RING_STATE_TABLE, S) of
|
||||
[Chx0] ->
|
||||
case DeleteFun(Chx0, D) of
|
||||
|
|
|
@ -158,18 +158,18 @@ policy_changed(_X1, _X2) -> ok.
|
|||
add_binding(_Serial, _X, #binding{source = S, destination = D, key = K}) ->
|
||||
Weight = rabbit_data_coercion:to_integer(K),
|
||||
?LOG_DEBUG("Consistent hashing exchange: adding binding from "
|
||||
"exchange ~ts to destination ~ts with routing key '~ts'", [rabbit_misc:rs(S), rabbit_misc:rs(D), K]),
|
||||
"exchange ~ts to destination ~ts with routing key '~ts'", [rabbit_misc:rs(S), rabbit_misc:rs(D), K]),
|
||||
case rabbit_db_ch_exchange:create_binding(S, D, Weight, fun chx_hash_ring_update_fun/3) of
|
||||
already_exists ->
|
||||
?LOG_DEBUG("Consistent hashing exchange: NOT adding binding from "
|
||||
"exchange ~s to destination ~s with routing key '~s' "
|
||||
"because this binding (possibly with a different "
|
||||
"routing key) already exists",
|
||||
[rabbit_misc:rs(S), rabbit_misc:rs(D), K]);
|
||||
"exchange ~s to destination ~s with routing key '~s' "
|
||||
"because this binding (possibly with a different "
|
||||
"routing key) already exists",
|
||||
[rabbit_misc:rs(S), rabbit_misc:rs(D), K]);
|
||||
created ->
|
||||
?LOG_DEBUG("Consistent hashing exchange: adding binding from "
|
||||
"exchange ~s to destination ~s with routing key '~s'",
|
||||
[rabbit_misc:rs(S), rabbit_misc:rs(D), K])
|
||||
"exchange ~s to destination ~s with routing key '~s'",
|
||||
[rabbit_misc:rs(S), rabbit_misc:rs(D), K])
|
||||
end.
|
||||
|
||||
chx_hash_ring_update_fun(#chx_hash_ring{bucket_map = BM0,
|
||||
|
|
|
@ -179,7 +179,7 @@ handle_info(check_internal_exchange, State = #state{internal_exchange = IntXName
|
|||
case check_internal_exchange(IntXNameBin, State) of
|
||||
upstream_not_found ->
|
||||
?LOG_WARNING("Federation link could not find upstream exchange '~ts' and will restart",
|
||||
[IntXNameBin]),
|
||||
[IntXNameBin]),
|
||||
{stop, {shutdown, restart}, State};
|
||||
_ ->
|
||||
TRef = erlang:send_after(Interval, self(), check_internal_exchange),
|
||||
|
@ -472,7 +472,7 @@ go(S0 = {not_started, {Upstream, UParams, DownXName}}) ->
|
|||
internal_exchange_interval = Interval}),
|
||||
Bindings),
|
||||
?LOG_INFO("Federation link for ~ts (upstream: ~ts) will perform internal exchange checks "
|
||||
"every ~b seconds", [rabbit_misc:rs(DownXName), UName, round(Interval / 1000)]),
|
||||
"every ~b seconds", [rabbit_misc:rs(DownXName), UName, round(Interval / 1000)]),
|
||||
TRef = erlang:send_after(Interval, self(), check_internal_exchange),
|
||||
{noreply, State#state{internal_exchange_timer = TRef}}
|
||||
end, Upstream, UParams, DownXName, S0).
|
||||
|
@ -485,12 +485,12 @@ log_link_startup_attempt(#upstream{name = Name, channel_use_mode = ChMode}, Down
|
|||
%% Otherwise open a separate one.
|
||||
reuse_command_channel(MainCh, #upstream{name = UName}, DownXName) ->
|
||||
?LOG_DEBUG("Will use a single channel for both schema operations and message transfer on links to upstream '~ts' for downstream federated ~ts",
|
||||
[UName, rabbit_misc:rs(DownXName)]),
|
||||
[UName, rabbit_misc:rs(DownXName)]),
|
||||
{ok, MainCh}.
|
||||
|
||||
open_command_channel(Conn, Upstream = #upstream{name = UName}, UParams, DownXName, S0) ->
|
||||
?LOG_DEBUG("Will open a command channel to upstream '~ts' for downstream federated ~ts",
|
||||
[UName, rabbit_misc:rs(DownXName)]),
|
||||
[UName, rabbit_misc:rs(DownXName)]),
|
||||
case amqp_connection:open_channel(Conn) of
|
||||
{ok, CCh} ->
|
||||
erlang:monitor(process, CCh),
|
||||
|
@ -585,7 +585,7 @@ ensure_internal_exchange(IntXNameBin,
|
|||
channel = Ch,
|
||||
downstream_exchange = #resource{virtual_host = DVhost}}) ->
|
||||
?LOG_DEBUG("Exchange federation will set up exchange '~ts' in upstream '~ts'",
|
||||
[IntXNameBin, UName]),
|
||||
[IntXNameBin, UName]),
|
||||
#upstream_params{params = Params} = rabbit_federation_util:deobfuscate_upstream_params(UParams),
|
||||
?LOG_DEBUG("Will delete upstream exchange '~ts'", [IntXNameBin]),
|
||||
delete_upstream_exchange(Conn, IntXNameBin),
|
||||
|
@ -615,7 +615,7 @@ check_internal_exchange(IntXNameBin,
|
|||
#upstream_params{params = Params} =
|
||||
rabbit_federation_util:deobfuscate_upstream_params(UParams),
|
||||
?LOG_DEBUG("Exchange federation will check on exchange '~ts' in upstream '~ts'",
|
||||
[IntXNameBin, UName]),
|
||||
[IntXNameBin, UName]),
|
||||
Base = #'exchange.declare'{exchange = IntXNameBin,
|
||||
passive = true,
|
||||
durable = true,
|
||||
|
@ -635,7 +635,7 @@ check_internal_exchange(IntXNameBin,
|
|||
upstream_not_found;
|
||||
(Code, Text) ->
|
||||
?LOG_WARNING("Federation ~ts internal upstream exchange check failed: ~tp ~tp",
|
||||
[rabbit_misc:rs(XName), Code, Text]),
|
||||
[rabbit_misc:rs(XName), Code, Text]),
|
||||
error
|
||||
end).
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ start(_Type, _StartArgs) ->
|
|||
start();
|
||||
false ->
|
||||
?LOG_WARNING("Metrics collection disabled in management agent, "
|
||||
"management only interface started", []),
|
||||
"management only interface started", []),
|
||||
start()
|
||||
end.
|
||||
|
||||
|
@ -89,8 +89,8 @@ get_listeners_config() ->
|
|||
{true, true, true} ->
|
||||
%% what is happening?
|
||||
?LOG_WARNING("Management plugin: TCP, TLS and a legacy (management.listener.*) listener are all configured. "
|
||||
"Only two listeners at a time are supported. "
|
||||
"Ignoring the legacy listener"),
|
||||
"Only two listeners at a time are supported. "
|
||||
"Ignoring the legacy listener"),
|
||||
[get_tcp_listener(),
|
||||
get_tls_listener()]
|
||||
end,
|
||||
|
|
|
@ -89,7 +89,7 @@ session_infos(Pids) ->
|
|||
{true, Infos};
|
||||
{error, Reason} ->
|
||||
?LOG_WARNING("failed to get infos for session ~p: ~tp",
|
||||
[Pid, Reason]),
|
||||
[Pid, Reason]),
|
||||
false
|
||||
end
|
||||
end, Pids).
|
||||
|
|
|
@ -203,9 +203,9 @@ get_autoscaling_group_node_list(Instance, Tag) ->
|
|||
end;
|
||||
error ->
|
||||
?LOG_WARNING("Cannot discover any nodes because no AWS "
|
||||
"autoscaling group could be found in "
|
||||
"the instance description. Make sure that this instance"
|
||||
" belongs to an autoscaling group.", []),
|
||||
"autoscaling group could be found in "
|
||||
"the instance description. Make sure that this instance"
|
||||
" belongs to an autoscaling group.", []),
|
||||
{ok, {[], disc}}
|
||||
end;
|
||||
_ ->
|
||||
|
@ -341,7 +341,7 @@ get_hostname_by_tags(Tags) ->
|
|||
case get_hostname_names(Path) of
|
||||
error ->
|
||||
?LOG_WARNING("Cannot discover any nodes because AWS "
|
||||
"instance description with tags ~tp failed", [Tags]),
|
||||
"instance description with tags ~tp failed", [Tags]),
|
||||
[];
|
||||
Names ->
|
||||
Names
|
||||
|
|
|
@ -53,10 +53,10 @@ list_nodes() ->
|
|||
Fun0 = fun() -> {ok, {[], disc}} end,
|
||||
Fun1 = fun() ->
|
||||
?LOG_WARNING("Peer discovery backend is set to ~ts "
|
||||
"but final config does not contain "
|
||||
"rabbit.cluster_formation.peer_discovery_etcd. "
|
||||
"Cannot discover any nodes because etcd cluster details are not configured!",
|
||||
[?MODULE]),
|
||||
"but final config does not contain "
|
||||
"rabbit.cluster_formation.peer_discovery_etcd. "
|
||||
"Cannot discover any nodes because etcd cluster details are not configured!",
|
||||
[?MODULE]),
|
||||
{ok, {[], disc}}
|
||||
end,
|
||||
Fun2 = fun(_Proplist) ->
|
||||
|
|
|
@ -87,7 +87,7 @@ callback_mode() -> [state_functions, state_enter].
|
|||
|
||||
terminate(Reason, State, Data) ->
|
||||
?LOG_DEBUG("etcd v3 API client will terminate in state ~tp, reason: ~tp",
|
||||
[State, Reason]),
|
||||
[State, Reason]),
|
||||
_ = disconnect(?ETCD_CONN_NAME, Data),
|
||||
?LOG_DEBUG("etcd v3 API client has disconnected"),
|
||||
?LOG_DEBUG("etcd v3 API client: total number of connections to etcd is ~tp", [length(eetcd_conn_sup:info())]),
|
||||
|
@ -135,11 +135,11 @@ unlock(ServerRef, LockKey) ->
|
|||
|
||||
recover(enter, _PrevState, #statem_data{endpoints = Endpoints}) ->
|
||||
?LOG_DEBUG("etcd v3 API client has entered recovery state, endpoints: ~ts",
|
||||
[string:join(Endpoints, ",")]),
|
||||
[string:join(Endpoints, ",")]),
|
||||
keep_state_and_data;
|
||||
recover(internal, start, Data = #statem_data{endpoints = Endpoints, connection_monitor = Ref}) ->
|
||||
?LOG_DEBUG("etcd v3 API client will attempt to connect, endpoints: ~ts",
|
||||
[string:join(Endpoints, ",")]),
|
||||
[string:join(Endpoints, ",")]),
|
||||
maybe_demonitor(Ref),
|
||||
case connect(?ETCD_CONN_NAME, Endpoints, Data) of
|
||||
{ok, Pid} ->
|
||||
|
@ -202,7 +202,7 @@ connected({call, From}, {unlock, GeneratedKey}, Data = #statem_data{connection_n
|
|||
reply_and_retain_state(From, ok);
|
||||
{error, _} = Error ->
|
||||
?LOG_DEBUG("etcd peer discovery: failed to release registration lock, lock owner key: ~ts, error ~tp",
|
||||
[GeneratedKey, Error]),
|
||||
[GeneratedKey, Error]),
|
||||
reply_and_retain_state(From, Error)
|
||||
end;
|
||||
connected({call, From}, register, Data = #statem_data{connection_name = Conn}) ->
|
||||
|
@ -234,7 +234,7 @@ connected({call, From}, list_keys, Data = #statem_data{connection_name = Conn})
|
|||
[length(Values)]),
|
||||
ParsedNodes = lists:filtermap(fun extract_node/1, Values),
|
||||
?LOG_INFO("etcd peer discovery: successfully extracted nodes: ~0tp",
|
||||
[ParsedNodes]),
|
||||
[ParsedNodes]),
|
||||
gen_statem:reply(From, lists:usort(ParsedNodes)),
|
||||
keep_state_and_data.
|
||||
|
||||
|
@ -298,7 +298,7 @@ extract_node({CreatedRev, Payload}) ->
|
|||
case rabbit_json:try_decode(Payload) of
|
||||
{error, _Error} ->
|
||||
?LOG_ERROR("etcd peer discovery: failed to extract node name from etcd value ~tp",
|
||||
[Payload]),
|
||||
[Payload]),
|
||||
false;
|
||||
{ok, Map} ->
|
||||
case maps:get(<<"node">>, Map, undefined) of
|
||||
|
@ -341,9 +341,9 @@ do_connect(Name, Endpoints, Data = #statem_data{username = Username}) ->
|
|||
false -> [Errors0]
|
||||
end,
|
||||
?LOG_DEBUG("etcd peer discovery: connection errors: ~tp",
|
||||
[Errors]),
|
||||
[Errors]),
|
||||
?LOG_DEBUG("etcd peer discovery: are all connection errors benign?: ~tp",
|
||||
[lists:all(fun error_is_already_started/1, Errors)]),
|
||||
[lists:all(fun error_is_already_started/1, Errors)]),
|
||||
%% If all errors are already_started we can ignore them.
|
||||
%% eetcd registers connections under a name
|
||||
case lists:all(fun error_is_already_started/1, Errors) of
|
||||
|
|
|
@ -64,7 +64,7 @@ seed_node(undefined, SeedNodeOrdinal) ->
|
|||
[Nodename],
|
||||
#{domain => ?RMQLOG_DOMAIN_PEER_DISC}),
|
||||
{error, lists:flatten(io_lib:format("my nodename (~s) doesn't seem to have the expected -ID suffix "
|
||||
"like StatefulSet pods should", [?MODULE:node()]))}
|
||||
"like StatefulSet pods should", [?MODULE:node()]))}
|
||||
end;
|
||||
seed_node(SeedNode, _SeedNodeOrdinal) ->
|
||||
% elp:ignore atoms_exhaustion
|
||||
|
|
|
@ -62,7 +62,7 @@ collect_mf(_Registry, Callback) ->
|
|||
catch
|
||||
exit:{timeout, _} ->
|
||||
?LOG_ERROR("alarm_metrics_collector failed to emit metrics: "
|
||||
"rabbitm_alarm:get_local_alarms timed out"),
|
||||
"rabbitm_alarm:get_local_alarms timed out"),
|
||||
%% We are not going to render any alarm metrics here.
|
||||
%% Breaks continuity but at least doesn't crash the
|
||||
%% whole scraping endpoint
|
||||
|
|
|
@ -92,8 +92,8 @@ declare_queue(XName, Durable, N, Node) ->
|
|||
catch
|
||||
_Error:Reason ->
|
||||
?LOG_ERROR("sharding failed to declare queue for exchange ~tp"
|
||||
" - soft error:~n~tp",
|
||||
[exchange_bin(XName), Reason]),
|
||||
" - soft error:~n~tp",
|
||||
[exchange_bin(XName), Reason]),
|
||||
error
|
||||
end.
|
||||
|
||||
|
|
|
@ -214,8 +214,8 @@ terminate({shutdown, restart}, State = #state{name = Name}) ->
|
|||
ok;
|
||||
terminate({{shutdown, {server_initiated_close, Code, Reason}}, _}, State = #state{name = Name}) ->
|
||||
?LOG_ERROR("Shovel ~ts is stopping: one of its connections closed "
|
||||
"with code ~b, reason: ~ts",
|
||||
[human_readable_name(Name), Code, Reason]),
|
||||
"with code ~b, reason: ~ts",
|
||||
[human_readable_name(Name), Code, Reason]),
|
||||
rabbit_shovel_status:report(State#state.name, State#state.type,
|
||||
{terminated, "needed a restart"}),
|
||||
close_connections(State),
|
||||
|
|
|
@ -49,7 +49,7 @@ resource_exists(ReqData, Context) ->
|
|||
case get_shovel_node(VHost, Name, ReqData, Context) of
|
||||
undefined ->
|
||||
?LOG_ERROR("Shovel with the name '~ts' was not found on virtual host '~ts'. "
|
||||
"It may be failing to connect and report its status.",
|
||||
"It may be failing to connect and report its status.",
|
||||
[Name, VHost]),
|
||||
case cowboy_req:method(ReqData) of
|
||||
<<"DELETE">> ->
|
||||
|
|
|
@ -89,7 +89,7 @@ parse_default_user([{passcode, Passcode} | Rest], Configuration) ->
|
|||
default_passcode = Passcode});
|
||||
parse_default_user([Unknown | Rest], Configuration) ->
|
||||
?LOG_WARNING("rabbit_stomp: ignoring invalid default_user "
|
||||
"configuration option: ~tp", [Unknown]),
|
||||
"configuration option: ~tp", [Unknown]),
|
||||
parse_default_user(Rest, Configuration).
|
||||
|
||||
report_configuration(#stomp_configuration{
|
||||
|
@ -99,7 +99,7 @@ report_configuration(#stomp_configuration{
|
|||
case Login of
|
||||
undefined -> ok;
|
||||
_ -> ?LOG_INFO("rabbit_stomp: default user '~ts' "
|
||||
"enabled", [Login])
|
||||
"enabled", [Login])
|
||||
end,
|
||||
|
||||
case ImplicitConnect of
|
||||
|
|
|
@ -616,19 +616,19 @@ do_login(Username, Passwd, VirtualHost, Heartbeat, AdapterInfo, Version,
|
|||
binary_to_list(Username) ++ "'", [], State);
|
||||
{error, not_allowed} ->
|
||||
?LOG_WARNING("STOMP login failed for user '~ts': "
|
||||
"virtual host access not allowed", [Username]),
|
||||
"virtual host access not allowed", [Username]),
|
||||
error("Bad CONNECT", "Virtual host '" ++
|
||||
binary_to_list(VirtualHost) ++
|
||||
"' access denied", State);
|
||||
{error, access_refused} ->
|
||||
?LOG_WARNING("STOMP login failed for user '~ts': "
|
||||
"virtual host access not allowed", [Username]),
|
||||
"virtual host access not allowed", [Username]),
|
||||
error("Bad CONNECT", "Virtual host '" ++
|
||||
binary_to_list(VirtualHost) ++
|
||||
"' access denied", State);
|
||||
{error, not_loopback} ->
|
||||
?LOG_WARNING("STOMP login failed for user '~ts': "
|
||||
"this user's access is restricted to localhost", [Username]),
|
||||
"this user's access is restricted to localhost", [Username]),
|
||||
error("Bad CONNECT", "non-loopback access denied", State)
|
||||
end.
|
||||
|
||||
|
@ -1196,10 +1196,10 @@ priv_error(Message, Format, Args, ServerPrivateDetail, State) ->
|
|||
|
||||
log_error(Message, Detail, ServerPrivateDetail) ->
|
||||
?LOG_ERROR("STOMP error frame sent:~n"
|
||||
"Message: ~tp~n"
|
||||
"Detail: ~tp~n"
|
||||
"Server private detail: ~tp",
|
||||
[Message, Detail, ServerPrivateDetail]).
|
||||
"Message: ~tp~n"
|
||||
"Detail: ~tp~n"
|
||||
"Server private detail: ~tp",
|
||||
[Message, Detail, ServerPrivateDetail]).
|
||||
|
||||
%%----------------------------------------------------------------------------
|
||||
%% Frame sending utilities
|
||||
|
|
|
@ -79,7 +79,7 @@ init([SupHelperPid, Ref, Configuration]) ->
|
|||
ProcInitArgs),
|
||||
|
||||
?LOG_INFO("accepting STOMP connection ~tp (~ts)",
|
||||
[self(), ConnName]),
|
||||
[self(), ConnName]),
|
||||
|
||||
ParseState = rabbit_stomp_frame:initial_state(),
|
||||
_ = register_resource_alarm(),
|
||||
|
@ -339,7 +339,7 @@ code_change(_OldVsn, State, _Extra) ->
|
|||
|
||||
log_reason({network_error, {ssl_upgrade_error, closed}, ConnName}, _State) ->
|
||||
?LOG_ERROR("STOMP detected TLS upgrade error on ~ts: connection closed",
|
||||
[ConnName]);
|
||||
[ConnName]);
|
||||
|
||||
|
||||
log_reason({network_error,
|
||||
|
@ -359,12 +359,10 @@ log_reason({network_error,
|
|||
{tls_alert, Alert}}, ConnName}, _State) ->
|
||||
log_tls_alert(Alert, ConnName);
|
||||
log_reason({network_error, {ssl_upgrade_error, Reason}, ConnName}, _State) ->
|
||||
?LOG_ERROR("STOMP detected TLS upgrade error on ~ts: ~tp",
|
||||
[ConnName, Reason]);
|
||||
?LOG_ERROR("STOMP detected TLS upgrade error on ~ts: ~tp", [ConnName, Reason]);
|
||||
|
||||
log_reason({network_error, Reason, ConnName}, _State) ->
|
||||
?LOG_ERROR("STOMP detected network error on ~ts: ~tp",
|
||||
[ConnName, Reason]);
|
||||
?LOG_ERROR("STOMP detected network error on ~ts: ~tp", [ConnName, Reason]);
|
||||
|
||||
log_reason({network_error, Reason}, _State) ->
|
||||
?LOG_ERROR("STOMP detected network error: ~tp", [Reason]);
|
||||
|
@ -373,12 +371,12 @@ log_reason({shutdown, client_heartbeat_timeout},
|
|||
#reader_state{ processor_state = ProcState }) ->
|
||||
AdapterName = rabbit_stomp_processor:adapter_name(ProcState),
|
||||
?LOG_WARNING("STOMP detected missed client heartbeat(s) "
|
||||
"on connection ~ts, closing it", [AdapterName]);
|
||||
"on connection ~ts, closing it", [AdapterName]);
|
||||
|
||||
log_reason({shutdown, {server_initiated_close, Reason}},
|
||||
#reader_state{conn_name = ConnName}) ->
|
||||
?LOG_INFO("closing STOMP connection ~tp (~ts), reason: ~ts",
|
||||
[self(), ConnName, Reason]);
|
||||
[self(), ConnName, Reason]);
|
||||
|
||||
log_reason(normal, #reader_state{conn_name = ConnName}) ->
|
||||
?LOG_INFO("closing STOMP connection ~tp (~ts)", [self(), ConnName]);
|
||||
|
@ -389,7 +387,7 @@ log_reason(shutdown, undefined) ->
|
|||
log_reason(Reason, #reader_state{processor_state = ProcState}) ->
|
||||
AdapterName = rabbit_stomp_processor:adapter_name(ProcState),
|
||||
?LOG_WARNING("STOMP connection ~ts terminated"
|
||||
" with reason ~tp, closing it", [AdapterName, Reason]).
|
||||
" with reason ~tp, closing it", [AdapterName, Reason]).
|
||||
|
||||
log_tls_alert(handshake_failure, ConnName) ->
|
||||
?LOG_ERROR("STOMP detected TLS upgrade error on ~ts: handshake failure",
|
||||
|
|
|
@ -66,23 +66,23 @@ delete(VirtualHost, Reference, Username) ->
|
|||
case rabbit_amqqueue:lookup(Name) of
|
||||
{ok, Q} ->
|
||||
?LOG_DEBUG("Found queue record ~tp, checking if it is a stream",
|
||||
[Reference]),
|
||||
[Reference]),
|
||||
case is_stream_queue(Q) of
|
||||
true ->
|
||||
?LOG_DEBUG("Queue record ~tp is a stream, trying to delete it",
|
||||
[Reference]),
|
||||
[Reference]),
|
||||
{ok, _} =
|
||||
rabbit_stream_queue:delete(Q, false, false, Username),
|
||||
?LOG_DEBUG("Stream ~tp deleted", [Reference]),
|
||||
{ok, deleted};
|
||||
_ ->
|
||||
?LOG_DEBUG("Queue record ~tp is NOT a stream, returning error",
|
||||
[Reference]),
|
||||
[Reference]),
|
||||
{error, reference_not_found}
|
||||
end;
|
||||
{error, not_found} ->
|
||||
?LOG_DEBUG("Stream ~tp not found, cannot delete it",
|
||||
[Reference]),
|
||||
[Reference]),
|
||||
{error, reference_not_found}
|
||||
end.
|
||||
|
||||
|
@ -173,8 +173,8 @@ delete_super_stream(VirtualHost, SuperStream, Username) ->
|
|||
ok;
|
||||
{error, Error} ->
|
||||
?LOG_WARNING("Error while deleting super stream exchange ~tp, "
|
||||
"~tp",
|
||||
[SuperStream, Error]),
|
||||
"~tp",
|
||||
[SuperStream, Error]),
|
||||
ok
|
||||
end,
|
||||
[begin
|
||||
|
@ -183,8 +183,8 @@ delete_super_stream(VirtualHost, SuperStream, Username) ->
|
|||
ok;
|
||||
{error, Err} ->
|
||||
?LOG_WARNING("Error while delete partition ~tp of super stream "
|
||||
"~tp, ~tp",
|
||||
[Stream, SuperStream, Err]),
|
||||
"~tp, ~tp",
|
||||
[Stream, SuperStream, Err]),
|
||||
ok
|
||||
end
|
||||
end
|
||||
|
@ -304,7 +304,7 @@ topology(VirtualHost, Stream) ->
|
|||
Members)};
|
||||
Err ->
|
||||
?LOG_INFO("Error locating ~tp stream members: ~tp",
|
||||
[StreamName, Err]),
|
||||
[StreamName, Err]),
|
||||
{error, stream_not_available}
|
||||
end;
|
||||
{error, not_found} ->
|
||||
|
@ -335,7 +335,7 @@ route(RoutingKey, VirtualHost, SuperStream) ->
|
|||
catch
|
||||
exit:Error ->
|
||||
?LOG_WARNING("Error while looking up exchange ~tp, ~tp",
|
||||
[rabbit_misc:rs(ExchangeName), Error]),
|
||||
[rabbit_misc:rs(ExchangeName), Error]),
|
||||
{error, stream_not_found}
|
||||
end.
|
||||
|
||||
|
@ -349,8 +349,8 @@ partitions(VirtualHost, SuperStream) ->
|
|||
partition_index(VirtualHost, SuperStream, Stream) ->
|
||||
ExchangeName = rabbit_misc:r(VirtualHost, exchange, SuperStream),
|
||||
?LOG_DEBUG("Looking for partition index of stream ~tp in "
|
||||
"super stream ~tp (virtual host ~tp)",
|
||||
[Stream, SuperStream, VirtualHost]),
|
||||
"super stream ~tp (virtual host ~tp)",
|
||||
[Stream, SuperStream, VirtualHost]),
|
||||
try
|
||||
_ = rabbit_exchange:lookup_or_die(ExchangeName),
|
||||
UnorderedBindings =
|
||||
|
@ -395,7 +395,7 @@ partition_index(VirtualHost, SuperStream, Stream) ->
|
|||
catch
|
||||
exit:Error ->
|
||||
?LOG_ERROR("Error while looking up exchange ~tp, ~tp",
|
||||
[ExchangeName, Error]),
|
||||
[ExchangeName, Error]),
|
||||
{error, stream_not_found}
|
||||
end.
|
||||
|
||||
|
@ -538,32 +538,32 @@ do_create_stream(VirtualHost, Reference, StreamQueueArguments, Username) ->
|
|||
{error, reference_already_exists};
|
||||
{error, Err} ->
|
||||
?LOG_WARNING("Error while creating ~tp stream, ~tp",
|
||||
[Reference, Err]),
|
||||
[Reference, Err]),
|
||||
{error, internal_error};
|
||||
{error,
|
||||
queue_limit_exceeded, Reason, ReasonArg} ->
|
||||
?LOG_WARNING("Cannot declare stream ~tp because, "
|
||||
++ Reason,
|
||||
[Reference] ++ ReasonArg),
|
||||
++ Reason,
|
||||
[Reference] ++ ReasonArg),
|
||||
{error, validation_failed};
|
||||
{protocol_error,
|
||||
precondition_failed,
|
||||
Msg,
|
||||
Args} ->
|
||||
?LOG_WARNING("Error while creating ~tp stream, "
|
||||
++ Msg,
|
||||
[Reference] ++ Args),
|
||||
++ Msg,
|
||||
[Reference] ++ Args),
|
||||
{error, validation_failed}
|
||||
end
|
||||
catch
|
||||
exit:Error ->
|
||||
?LOG_ERROR("Error while creating ~tp stream, ~tp",
|
||||
[Reference, Error]),
|
||||
[Reference, Error]),
|
||||
{error, internal_error}
|
||||
end;
|
||||
{error, {absent, _, Reason}} ->
|
||||
?LOG_ERROR("Error while creating ~tp stream, ~tp",
|
||||
[Reference, Reason]),
|
||||
[Reference, Reason]),
|
||||
{error, internal_error}
|
||||
end
|
||||
catch
|
||||
|
@ -572,12 +572,12 @@ do_create_stream(VirtualHost, Reference, StreamQueueArguments, Username) ->
|
|||
% likely a problem of inequivalent args on an existing stream
|
||||
{amqp_error, precondition_failed, M, _} ->
|
||||
?LOG_INFO("Error while creating ~tp stream, "
|
||||
++ M,
|
||||
[Reference]),
|
||||
++ M,
|
||||
[Reference]),
|
||||
{error, validation_failed};
|
||||
E ->
|
||||
?LOG_WARNING("Error while creating ~tp stream, ~tp",
|
||||
[Reference, E]),
|
||||
[Reference, E]),
|
||||
{error, validation_failed}
|
||||
end
|
||||
end.
|
||||
|
@ -605,7 +605,7 @@ super_stream_partitions(VirtualHost, SuperStream) ->
|
|||
catch
|
||||
exit:Error ->
|
||||
?LOG_ERROR("Error while looking up exchange ~tp, ~tp",
|
||||
[ExchangeName, Error]),
|
||||
[ExchangeName, Error]),
|
||||
{error, stream_not_found}
|
||||
end.
|
||||
|
||||
|
@ -734,8 +734,8 @@ declare_super_stream_exchange(VirtualHost, Name, Username) ->
|
|||
exit:ExitError ->
|
||||
% likely to be a problem of inequivalent args on an existing stream
|
||||
?LOG_ERROR("Error while creating ~tp super stream exchange: "
|
||||
"~tp",
|
||||
[Name, ExitError]),
|
||||
"~tp",
|
||||
[Name, ExitError]),
|
||||
{error, validation_failed}
|
||||
end;
|
||||
{error, timeout} = Err ->
|
||||
|
|
|
@ -125,7 +125,7 @@ terminate(Reason, State,
|
|||
rabbit_networking:unregister_non_amqp_connection(self()),
|
||||
notify_connection_closed(StatemData),
|
||||
?LOG_DEBUG("~ts terminating in state '~ts' with reason '~W'",
|
||||
[?MODULE, State, Reason, 10]).
|
||||
[?MODULE, State, Reason, 10]).
|
||||
|
||||
start_link(KeepaliveSup, Transport, Ref, Opts) ->
|
||||
{ok,
|
||||
|
@ -223,7 +223,7 @@ init([KeepaliveSup,
|
|||
{Error, Reason} ->
|
||||
rabbit_net:fast_close(RealSocket),
|
||||
?LOG_WARNING("Closing connection because of ~tp ~tp",
|
||||
[Error, Reason])
|
||||
[Error, Reason])
|
||||
end.
|
||||
|
||||
tcp_connected(enter, _OldState,
|
||||
|
@ -414,8 +414,8 @@ tuned({call, From}, {info, _Items}, _StateData) ->
|
|||
|
||||
state_timeout(State, Transport, Socket) ->
|
||||
?LOG_WARNING("Closing connection because of timeout in state "
|
||||
"'~ts' likely due to lack of client action.",
|
||||
[State]),
|
||||
"'~ts' likely due to lack of client action.",
|
||||
[State]),
|
||||
close_immediately(Transport, Socket),
|
||||
stop.
|
||||
|
||||
|
@ -441,12 +441,10 @@ handle_info(Msg,
|
|||
#stream_connection{connection_step = NewConnectionStep} =
|
||||
Connection1,
|
||||
?LOG_DEBUG("Transitioned from ~ts to ~ts",
|
||||
[PreviousConnectionStep,
|
||||
NewConnectionStep]),
|
||||
[PreviousConnectionStep, NewConnectionStep]),
|
||||
Transition(NewConnectionStep, StatemData, Connection1, State1);
|
||||
{Closed, S} ->
|
||||
?LOG_DEBUG("Stream protocol connection socket ~w closed",
|
||||
[S]),
|
||||
?LOG_DEBUG("Stream protocol connection socket ~w closed", [S]),
|
||||
stop;
|
||||
{Error, S, Reason} ->
|
||||
?LOG_WARNING("Socket error ~tp [~w]", [Reason, S]),
|
||||
|
@ -494,8 +492,7 @@ transition_to_opened(Transport,
|
|||
|
||||
invalid_transition(Transport, Socket, From, To) ->
|
||||
?LOG_WARNING("Closing socket ~w. Invalid transition from ~ts "
|
||||
"to ~ts.",
|
||||
[Socket, From, To]),
|
||||
"to ~ts.", [Socket, From, To]),
|
||||
close_immediately(Transport, Socket),
|
||||
stop.
|
||||
|
||||
|
@ -515,7 +512,7 @@ socket_op(Sock, Fun) ->
|
|||
Res;
|
||||
{error, Reason} ->
|
||||
?LOG_WARNING("Error during socket operation ~tp",
|
||||
[Reason]),
|
||||
[Reason]),
|
||||
rabbit_net:fast_close(RealSocket),
|
||||
exit(normal)
|
||||
end.
|
||||
|
@ -639,8 +636,7 @@ open(info, {resource_alarm, IsThereAlarm},
|
|||
CreditsRequiredForUnblocking}} =
|
||||
StatemData) ->
|
||||
?LOG_DEBUG("Connection ~tp received resource alarm. Alarm "
|
||||
"on? ~tp",
|
||||
[ConnectionName, IsThereAlarm]),
|
||||
"on? ~tp", [ConnectionName, IsThereAlarm]),
|
||||
EnoughCreditsToUnblock =
|
||||
has_enough_credits_to_unblock(Credits, CreditsRequiredForUnblocking),
|
||||
NewBlockedState =
|
||||
|
@ -651,18 +647,18 @@ open(info, {resource_alarm, IsThereAlarm},
|
|||
not EnoughCredits
|
||||
end,
|
||||
?LOG_DEBUG("Connection ~tp had blocked status set to ~tp, "
|
||||
"new blocked status is now ~tp",
|
||||
[ConnectionName, Blocked, NewBlockedState]),
|
||||
"new blocked status is now ~tp",
|
||||
[ConnectionName, Blocked, NewBlockedState]),
|
||||
case {Blocked, NewBlockedState} of
|
||||
{true, false} ->
|
||||
setopts(Transport, S, [{active, once}]),
|
||||
ok = rabbit_heartbeat:resume_monitor(Heartbeater),
|
||||
?LOG_DEBUG("Unblocking connection ~tp",
|
||||
[ConnectionName]);
|
||||
[ConnectionName]);
|
||||
{false, true} ->
|
||||
ok = rabbit_heartbeat:pause_monitor(Heartbeater),
|
||||
?LOG_DEBUG("Blocking connection ~tp after resource alarm",
|
||||
[ConnectionName]);
|
||||
[ConnectionName]);
|
||||
_ ->
|
||||
ok
|
||||
end,
|
||||
|
@ -744,8 +740,8 @@ open(info,
|
|||
end,
|
||||
|
||||
?LOG_DEBUG("Subscription ~tp on ~tp instructed to become active: "
|
||||
"~tp",
|
||||
[SubId, Stream, Active]),
|
||||
"~tp",
|
||||
[SubId, Stream, Active]),
|
||||
{Connection1, ConnState1} =
|
||||
case Consumers0 of
|
||||
#{SubId :=
|
||||
|
@ -763,8 +759,8 @@ open(info,
|
|||
undefined;
|
||||
{false, L} ->
|
||||
?LOG_DEBUG("Closing Osiris segment of subscription ~tp for "
|
||||
"now",
|
||||
[SubId]),
|
||||
"now",
|
||||
[SubId]),
|
||||
osiris_log:close(L),
|
||||
undefined;
|
||||
_ ->
|
||||
|
@ -790,20 +786,20 @@ open(info,
|
|||
Consumer1}}};
|
||||
false ->
|
||||
?LOG_WARNING("Received SAC event for subscription ~tp, which "
|
||||
"is not a SAC. Not doing anything.",
|
||||
[SubId]),
|
||||
"is not a SAC. Not doing anything.",
|
||||
[SubId]),
|
||||
{Connection0, ConnState0}
|
||||
end;
|
||||
_ ->
|
||||
?LOG_DEBUG("Subscription ~tp on ~tp has been deleted.",
|
||||
[SubId, Stream]),
|
||||
[SubId, Stream]),
|
||||
?LOG_DEBUG("Active ~tp, message ~tp", [Active, Msg]),
|
||||
_ = case {Active, Msg} of
|
||||
{false, #{stepping_down := true,
|
||||
stream := St,
|
||||
consumer_name := ConsumerName}} ->
|
||||
?LOG_DEBUG("Former active consumer gone, activating consumer " ++
|
||||
"on stream ~tp, group ~tp", [St, ConsumerName]),
|
||||
"on stream ~tp, group ~tp", [St, ConsumerName]),
|
||||
sac_activate_consumer(VirtualHost, St, ConsumerName);
|
||||
_ ->
|
||||
ok
|
||||
|
@ -817,14 +813,14 @@ open(info, {Closed, Socket}, #statem_data{connection = Connection})
|
|||
when Closed =:= tcp_closed; Closed =:= ssl_closed ->
|
||||
_ = demonitor_all_streams(Connection),
|
||||
?LOG_WARNING("Stream reader socket ~w closed [~w]",
|
||||
[Socket, self()]),
|
||||
[Socket, self()]),
|
||||
stop;
|
||||
open(info, {Error, Socket, Reason},
|
||||
#statem_data{connection = Connection})
|
||||
when Error =:= tcp_error; Error =:= ssl_error ->
|
||||
_ = demonitor_all_streams(Connection),
|
||||
?LOG_ERROR("Stream reader socket error ~tp [~w] [~w]",
|
||||
[Reason, Socket, self()]),
|
||||
[Reason, Socket, self()]),
|
||||
stop;
|
||||
open(info, {'DOWN', MonitorRef, process, _OsirisPid, _Reason},
|
||||
#statem_data{transport = Transport,
|
||||
|
@ -867,7 +863,7 @@ open(info, heartbeat_send,
|
|||
keep_state_and_data;
|
||||
Unexpected ->
|
||||
?LOG_INFO("Heartbeat send error ~tp, closing connection",
|
||||
[Unexpected]),
|
||||
[Unexpected]),
|
||||
_C1 = demonitor_all_streams(Connection),
|
||||
stop
|
||||
end;
|
||||
|
@ -899,7 +895,7 @@ open(info, check_outstanding_requests,
|
|||
case (Time - Start) > Timeout of
|
||||
true ->
|
||||
?LOG_DEBUG("Request ~tp with content ~tp has timed out",
|
||||
[K, Ctnt]),
|
||||
[K, Ctnt]),
|
||||
|
||||
true;
|
||||
false ->
|
||||
|
@ -909,7 +905,7 @@ open(info, check_outstanding_requests,
|
|||
case HasTimedOut of
|
||||
true ->
|
||||
?LOG_INFO("Forcing stream connection ~tp closing: request to client timed out",
|
||||
[self()]),
|
||||
[self()]),
|
||||
_ = demonitor_all_streams(Connection0),
|
||||
{stop, {request_timeout, <<"Request timeout">>}};
|
||||
false ->
|
||||
|
@ -928,12 +924,12 @@ open(info, {shutdown, Explanation} = Reason,
|
|||
%% rabbitmq_management or rabbitmq_stream_management plugin
|
||||
%% requests to close connection.
|
||||
?LOG_INFO("Forcing stream connection ~tp closing: ~tp",
|
||||
[self(), Explanation]),
|
||||
[self(), Explanation]),
|
||||
_ = demonitor_all_streams(Connection),
|
||||
{stop, Reason};
|
||||
open(info, Unknown, _StatemData) ->
|
||||
?LOG_WARNING("Received unknown message ~tp in state ~ts",
|
||||
[Unknown, ?FUNCTION_NAME]),
|
||||
[Unknown, ?FUNCTION_NAME]),
|
||||
%% FIXME send close
|
||||
keep_state_and_data;
|
||||
open({call, From}, info,
|
||||
|
@ -1055,8 +1051,8 @@ open(cast,
|
|||
{osiris_offset, _QueueResource, -1}},
|
||||
_StatemData) ->
|
||||
?LOG_DEBUG("Stream protocol connection received osiris offset "
|
||||
"event for ~tp with offset ~tp",
|
||||
[StreamName, -1]),
|
||||
"event for ~tp with offset ~tp",
|
||||
[StreamName, -1]),
|
||||
keep_state_and_data;
|
||||
open(cast,
|
||||
{queue_event, #resource{name = StreamName},
|
||||
|
@ -1076,14 +1072,14 @@ open(cast,
|
|||
case maps:get(StreamName, StreamSubscriptions, undefined) of
|
||||
undefined ->
|
||||
?LOG_DEBUG("Stream protocol connection: osiris offset event "
|
||||
"for ~tp, but no subscription (leftover messages "
|
||||
"after unsubscribe?)",
|
||||
[StreamName]),
|
||||
"for ~tp, but no subscription (leftover messages "
|
||||
"after unsubscribe?)",
|
||||
[StreamName]),
|
||||
{Connection, State};
|
||||
[] ->
|
||||
?LOG_DEBUG("Stream protocol connection: osiris offset event "
|
||||
"for ~tp, but no registered consumers!",
|
||||
[StreamName]),
|
||||
"for ~tp, but no registered consumers!",
|
||||
[StreamName]),
|
||||
{Connection#stream_connection{stream_subscriptions =
|
||||
maps:remove(StreamName,
|
||||
StreamSubscriptions)},
|
||||
|
@ -1106,13 +1102,11 @@ open(cast,
|
|||
SendFileOct)
|
||||
of
|
||||
{error, closed} ->
|
||||
?LOG_INFO("Stream protocol connection has been closed by "
|
||||
"peer",
|
||||
[]),
|
||||
?LOG_INFO("Stream protocol connection has been closed by peer", []),
|
||||
throw({stop, normal});
|
||||
{error, Reason} ->
|
||||
?LOG_INFO("Error while sending chunks: ~tp",
|
||||
[Reason]),
|
||||
[Reason]),
|
||||
%% likely a connection problem
|
||||
Consumer;
|
||||
{ok, Csmr} -> Csmr
|
||||
|
@ -1152,8 +1146,8 @@ close_sent(enter, _OldState,
|
|||
{keep_state_and_data, {state_timeout, StateTimeout, close}};
|
||||
close_sent(state_timeout, close, #statem_data{}) ->
|
||||
?LOG_WARNING("Closing connection because of timeout in state "
|
||||
"'~ts' likely due to lack of client action.",
|
||||
[?FUNCTION_NAME]),
|
||||
"'~ts' likely due to lack of client action.",
|
||||
[?FUNCTION_NAME]),
|
||||
stop;
|
||||
close_sent(info, {tcp, S, Data},
|
||||
#statem_data{transport = Transport,
|
||||
|
@ -1165,7 +1159,7 @@ close_sent(info, {tcp, S, Data},
|
|||
handle_inbound_data_post_close(Transport, Connection, State, Data),
|
||||
#stream_connection{connection_step = Step} = Connection1,
|
||||
?LOG_DEBUG("Stream reader has transitioned from ~ts to ~ts",
|
||||
[?FUNCTION_NAME, Step]),
|
||||
[?FUNCTION_NAME, Step]),
|
||||
case Step of
|
||||
closing_done ->
|
||||
stop;
|
||||
|
@ -1177,25 +1171,25 @@ close_sent(info, {tcp, S, Data},
|
|||
end;
|
||||
close_sent(info, {tcp_closed, S}, _StatemData) ->
|
||||
?LOG_DEBUG("Stream protocol connection socket ~w closed [~w]",
|
||||
[S, self()]),
|
||||
[S, self()]),
|
||||
stop;
|
||||
close_sent(info, {tcp_error, S, Reason}, #statem_data{}) ->
|
||||
?LOG_ERROR("Stream protocol connection socket error: ~tp "
|
||||
"[~w] [~w]",
|
||||
[Reason, S, self()]),
|
||||
"[~w] [~w]",
|
||||
[Reason, S, self()]),
|
||||
stop;
|
||||
close_sent(info, {resource_alarm, IsThereAlarm},
|
||||
StatemData = #statem_data{connection = Connection}) ->
|
||||
?LOG_WARNING("Stream protocol connection ignored a resource "
|
||||
"alarm ~tp in state ~ts",
|
||||
[IsThereAlarm, ?FUNCTION_NAME]),
|
||||
"alarm ~tp in state ~ts",
|
||||
[IsThereAlarm, ?FUNCTION_NAME]),
|
||||
{keep_state,
|
||||
StatemData#statem_data{connection =
|
||||
Connection#stream_connection{resource_alarm =
|
||||
IsThereAlarm}}};
|
||||
close_sent(info, Msg, _StatemData) ->
|
||||
?LOG_WARNING("Ignored unknown message ~tp in state ~ts",
|
||||
[Msg, ?FUNCTION_NAME]),
|
||||
[Msg, ?FUNCTION_NAME]),
|
||||
keep_state_and_data;
|
||||
close_sent({call, From}, {info, _Items}, _StateData) ->
|
||||
%% must be a CLI call, returning no information
|
||||
|
@ -1390,7 +1384,7 @@ handle_frame_pre_auth(Transport,
|
|||
Username,
|
||||
stream),
|
||||
?LOG_WARNING("User '~ts' can only connect via localhost",
|
||||
[Username]),
|
||||
[Username]),
|
||||
{C1#stream_connection{connection_step =
|
||||
failure},
|
||||
{sasl_authenticate, ?RESPONSE_SASL_AUTHENTICATION_FAILURE_LOOPBACK,
|
||||
|
@ -1427,7 +1421,7 @@ handle_frame_pre_auth(_Transport,
|
|||
#stream_connection_state{blocked = Blocked} = State,
|
||||
{tune, FrameMax, Heartbeat}) ->
|
||||
?LOG_DEBUG("Tuning response ~tp ~tp ",
|
||||
[FrameMax, Heartbeat]),
|
||||
[FrameMax, Heartbeat]),
|
||||
Parent = self(),
|
||||
%% sending a message to the main process so the heartbeat frame is sent from this main process
|
||||
%% otherwise heartbeat frames can interleave with chunk delivery
|
||||
|
@ -1524,7 +1518,7 @@ handle_frame_pre_auth(_Transport, Connection, State, heartbeat) ->
|
|||
{Connection, State};
|
||||
handle_frame_pre_auth(_Transport, Connection, State, Command) ->
|
||||
?LOG_WARNING("unknown command ~w, closing connection.",
|
||||
[Command]),
|
||||
[Command]),
|
||||
{Connection#stream_connection{connection_step = failure}, State}.
|
||||
|
||||
auth_fail(Username, Msg, Args, Connection, ConnectionState) ->
|
||||
|
@ -1568,8 +1562,8 @@ handle_frame_post_auth(Transport,
|
|||
_WriterRef,
|
||||
Stream}}) ->
|
||||
?LOG_INFO("Cannot create publisher ~tp on stream ~tp, connection "
|
||||
"is blocked because of resource alarm",
|
||||
[PublisherId, Stream]),
|
||||
"is blocked because of resource alarm",
|
||||
[PublisherId, Stream]),
|
||||
response(Transport,
|
||||
Connection0,
|
||||
declare_publisher,
|
||||
|
@ -1645,7 +1639,7 @@ handle_frame_post_auth(Transport,
|
|||
Username,
|
||||
stream),
|
||||
?LOG_WARNING("Not allowed to change username '~ts'. Only password",
|
||||
[Username]),
|
||||
[Username]),
|
||||
{C1#stream_connection{connection_step =
|
||||
failure},
|
||||
{sasl_authenticate,
|
||||
|
@ -1666,7 +1660,7 @@ handle_frame_post_auth(Transport,
|
|||
end;
|
||||
{OtherMechanism, _} ->
|
||||
?LOG_WARNING("User '~ts' cannot change initial auth mechanism '~ts' for '~ts'",
|
||||
[Username, NewMechanism, OtherMechanism]),
|
||||
[Username, NewMechanism, OtherMechanism]),
|
||||
CmdBody =
|
||||
{sasl_authenticate, ?RESPONSE_SASL_CANNOT_CHANGE_MECHANISM, <<>>},
|
||||
Frame = rabbit_stream_core:frame({response, CorrelationId, CmdBody}),
|
||||
|
@ -1770,10 +1764,10 @@ handle_frame_post_auth(Transport,
|
|||
end;
|
||||
{PublisherIdTaken, ReferenceTaken} ->
|
||||
?LOG_WARNING("Error while declaring publisher ~tp for stream '~ts', "
|
||||
"with reference '~ts'. ID already taken: ~tp. "
|
||||
"Reference already taken: ~tp.",
|
||||
[PublisherId, Stream, WriterRef,
|
||||
PublisherIdTaken, ReferenceTaken]),
|
||||
"with reference '~ts'. ID already taken: ~tp. "
|
||||
"Reference already taken: ~tp.",
|
||||
[PublisherId, Stream, WriterRef,
|
||||
PublisherIdTaken, ReferenceTaken]),
|
||||
response(Transport,
|
||||
Connection0,
|
||||
declare_publisher,
|
||||
|
@ -1985,19 +1979,16 @@ handle_frame_post_auth(Transport,
|
|||
{Connection, State};
|
||||
false ->
|
||||
?LOG_DEBUG("Creating subscription ~tp to ~tp, with offset "
|
||||
"specification ~tp, properties ~0p",
|
||||
[SubscriptionId,
|
||||
Stream,
|
||||
OffsetSpec,
|
||||
Properties]),
|
||||
"specification ~tp, properties ~0p",
|
||||
[SubscriptionId, Stream, OffsetSpec, Properties]),
|
||||
Sac = single_active_consumer(Properties),
|
||||
ConsumerName = consumer_name(Properties),
|
||||
case {Sac, ConsumerName}
|
||||
of
|
||||
{true, undefined} ->
|
||||
?LOG_WARNING("Cannot create subcription ~tp, a single active "
|
||||
"consumer must have a name",
|
||||
[SubscriptionId]),
|
||||
"consumer must have a name",
|
||||
[SubscriptionId]),
|
||||
response(Transport,
|
||||
Connection,
|
||||
subscribe,
|
||||
|
@ -2034,7 +2025,7 @@ handle_frame_post_auth(Transport,
|
|||
%% from a formerly active consumer. Taking the credits,
|
||||
%% logging and sending an error
|
||||
?LOG_DEBUG("Giving credit to an inactive consumer: ~tp",
|
||||
[SubscriptionId]),
|
||||
[SubscriptionId]),
|
||||
#consumer{credit = AvailableCredit} = Consumer,
|
||||
Consumer1 = Consumer#consumer{credit = AvailableCredit + Credit},
|
||||
|
||||
|
@ -2058,9 +2049,7 @@ handle_frame_post_auth(Transport,
|
|||
SendFileOct)
|
||||
of
|
||||
{error, closed} ->
|
||||
?LOG_INFO("Stream protocol connection has been closed by "
|
||||
"peer",
|
||||
[]),
|
||||
?LOG_INFO("Stream protocol connection has been closed by peer", []),
|
||||
throw({stop, normal});
|
||||
{ok, Consumer1} ->
|
||||
{Connection,
|
||||
|
@ -2071,7 +2060,7 @@ handle_frame_post_auth(Transport,
|
|||
end;
|
||||
_ ->
|
||||
?LOG_WARNING("Giving credit to unknown subscription: ~tp",
|
||||
[SubscriptionId]),
|
||||
[SubscriptionId]),
|
||||
|
||||
Code = ?RESPONSE_CODE_SUBSCRIPTION_ID_DOES_NOT_EXIST,
|
||||
Frame =
|
||||
|
@ -2096,7 +2085,7 @@ handle_frame_post_auth(_Transport,
|
|||
store_offset(Reference, Stream, Offset, Connection0);
|
||||
_ ->
|
||||
?LOG_WARNING("Not authorized to store offset on stream ~tp",
|
||||
[Stream]),
|
||||
[Stream]),
|
||||
Connection0
|
||||
end
|
||||
end,
|
||||
|
@ -2184,8 +2173,8 @@ handle_frame_post_auth(Transport,
|
|||
#{leader_node := LeaderPid,
|
||||
replica_nodes := ReturnedReplicas}} ->
|
||||
?LOG_DEBUG("Created stream cluster with leader on ~tp and "
|
||||
"replicas on ~tp",
|
||||
[LeaderPid, ReturnedReplicas]),
|
||||
"replicas on ~tp",
|
||||
[LeaderPid, ReturnedReplicas]),
|
||||
response_ok(Transport,
|
||||
Connection,
|
||||
create_stream,
|
||||
|
@ -2348,7 +2337,7 @@ handle_frame_post_auth(Transport,
|
|||
{true, true} -> Acc#{Node => {Host, Port}};
|
||||
_ ->
|
||||
?LOG_WARNING("Error when retrieving broker metadata: ~tp ~tp",
|
||||
[Host, Port]),
|
||||
[Host, Port]),
|
||||
Acc
|
||||
end
|
||||
end,
|
||||
|
@ -2447,15 +2436,14 @@ handle_frame_post_auth(Transport,
|
|||
?RESPONSE_CODE_OK ->
|
||||
ok;
|
||||
RC ->
|
||||
?LOG_INFO("Unexpected consumer update response code: ~tp",
|
||||
[RC])
|
||||
?LOG_INFO("Unexpected consumer update response code: ~tp", [RC])
|
||||
end,
|
||||
case maps:take(CorrelationId, Requests0) of
|
||||
{#request{content = #{subscription_id := SubscriptionId} = Msg}, Rs} ->
|
||||
Stream = stream_from_consumers(SubscriptionId, Consumers),
|
||||
?LOG_DEBUG("Received consumer update response for subscription "
|
||||
"~tp on stream ~tp, correlation ID ~tp",
|
||||
[SubscriptionId, Stream, CorrelationId]),
|
||||
"~tp on stream ~tp, correlation ID ~tp",
|
||||
[SubscriptionId, Stream, CorrelationId]),
|
||||
Consumers1 =
|
||||
case Consumers of
|
||||
#{SubscriptionId :=
|
||||
|
@ -2482,9 +2470,9 @@ handle_frame_post_auth(Transport,
|
|||
end,
|
||||
|
||||
?LOG_DEBUG("Initializing reader for active consumer "
|
||||
"(subscription ~tp, stream ~tp), offset "
|
||||
"spec is ~tp",
|
||||
[SubscriptionId, Stream, OffsetSpec]),
|
||||
"(subscription ~tp, stream ~tp), offset "
|
||||
"spec is ~tp",
|
||||
[SubscriptionId, Stream, OffsetSpec]),
|
||||
QueueResource =
|
||||
#resource{name = Stream,
|
||||
kind = queue,
|
||||
|
@ -2503,11 +2491,8 @@ handle_frame_post_auth(Transport,
|
|||
configuration = #consumer_configuration{counters = ConsumerCounters}} = Consumer1,
|
||||
|
||||
?LOG_DEBUG("Dispatching to subscription ~tp (stream ~tp), "
|
||||
"credit(s) ~tp, send limit ~tp",
|
||||
[SubscriptionId,
|
||||
Stream,
|
||||
Crdt,
|
||||
SndLmt]),
|
||||
"credit(s) ~tp, send limit ~tp",
|
||||
[SubscriptionId, Stream, Crdt, SndLmt]),
|
||||
|
||||
ConsumedMessagesBefore = messages_consumed(ConsumerCounters),
|
||||
|
||||
|
@ -2518,13 +2503,11 @@ handle_frame_post_auth(Transport,
|
|||
SendFileOct)
|
||||
of
|
||||
{error, closed} ->
|
||||
?LOG_INFO("Stream protocol connection has been closed by "
|
||||
"peer",
|
||||
[]),
|
||||
?LOG_INFO("Stream protocol connection has been closed by peer", []),
|
||||
throw({stop, normal});
|
||||
{error, Reason} ->
|
||||
?LOG_INFO("Error while sending chunks: ~tp",
|
||||
[Reason]),
|
||||
[Reason]),
|
||||
%% likely a connection problem
|
||||
Consumer;
|
||||
{ok, Csmr} ->
|
||||
|
@ -2535,11 +2518,9 @@ handle_frame_post_auth(Transport,
|
|||
|
||||
ConsumedMessagesAfter = messages_consumed(ConsumerCounters),
|
||||
?LOG_DEBUG("Subscription ~tp (stream ~tp) is now at offset ~tp with ~tp "
|
||||
"message(s) distributed after subscription",
|
||||
[SubscriptionId,
|
||||
Stream,
|
||||
ConsumerOffset,
|
||||
ConsumedMessagesAfter - ConsumedMessagesBefore]),
|
||||
"message(s) distributed after subscription",
|
||||
[SubscriptionId, Stream, ConsumerOffset,
|
||||
ConsumedMessagesAfter - ConsumedMessagesBefore]),
|
||||
|
||||
Consumers#{SubscriptionId => Consumer2};
|
||||
#{SubscriptionId :=
|
||||
|
@ -2554,8 +2535,8 @@ handle_frame_post_auth(Transport,
|
|||
#{stepping_down := true} ->
|
||||
ConsumerName = consumer_name(Properties),
|
||||
?LOG_DEBUG("Subscription ~tp on stream ~tp, group ~tp " ++
|
||||
"has stepped down, activating consumer",
|
||||
[SubscriptionId, Stream, ConsumerName]),
|
||||
"has stepped down, activating consumer",
|
||||
[SubscriptionId, Stream, ConsumerName]),
|
||||
_ = sac_activate_consumer(VirtualHost, Stream,
|
||||
ConsumerName),
|
||||
ok;
|
||||
|
@ -2566,7 +2547,7 @@ handle_frame_post_auth(Transport,
|
|||
Consumers;
|
||||
_ ->
|
||||
?LOG_DEBUG("No consumer found for subscription ~tp",
|
||||
[SubscriptionId]),
|
||||
[SubscriptionId]),
|
||||
Consumers
|
||||
end,
|
||||
|
||||
|
@ -2574,14 +2555,14 @@ handle_frame_post_auth(Transport,
|
|||
State#stream_connection_state{consumers = Consumers1}};
|
||||
{V, _Rs} ->
|
||||
?LOG_WARNING("Unexpected outstanding requests for correlation "
|
||||
"ID ~tp: ~tp",
|
||||
[CorrelationId, V]),
|
||||
"ID ~tp: ~tp",
|
||||
[CorrelationId, V]),
|
||||
{Connection, State};
|
||||
error ->
|
||||
?LOG_WARNING("Could not find outstanding consumer update request "
|
||||
"with correlation ID ~tp. No actions taken for "
|
||||
"the subscription.",
|
||||
[CorrelationId]),
|
||||
"with correlation ID ~tp. No actions taken for "
|
||||
"the subscription.",
|
||||
[CorrelationId]),
|
||||
{Connection, State}
|
||||
end;
|
||||
handle_frame_post_auth(Transport,
|
||||
|
@ -2667,7 +2648,7 @@ handle_frame_post_auth(Transport,
|
|||
{Connection, State};
|
||||
{error, {validation_failed, Msg}} ->
|
||||
?LOG_WARNING("Error while trying to create super stream ~tp: ~tp",
|
||||
[SuperStreamName, Msg]),
|
||||
[SuperStreamName, Msg]),
|
||||
response(Transport,
|
||||
Connection,
|
||||
create_super_stream,
|
||||
|
@ -2677,7 +2658,7 @@ handle_frame_post_auth(Transport,
|
|||
{Connection, State};
|
||||
{error, {reference_already_exists, Msg}} ->
|
||||
?LOG_WARNING("Error while trying to create super stream ~tp: ~tp",
|
||||
[SuperStreamName, Msg]),
|
||||
[SuperStreamName, Msg]),
|
||||
response(Transport,
|
||||
Connection,
|
||||
create_super_stream,
|
||||
|
@ -2687,7 +2668,7 @@ handle_frame_post_auth(Transport,
|
|||
{Connection, State};
|
||||
{error, Error} ->
|
||||
?LOG_WARNING("Error while trying to create super stream ~tp: ~tp",
|
||||
[SuperStreamName, Error]),
|
||||
[SuperStreamName, Error]),
|
||||
response(Transport,
|
||||
Connection,
|
||||
create_super_stream,
|
||||
|
@ -2766,8 +2747,8 @@ handle_frame_post_auth(Transport,
|
|||
{request, CorrelationId,
|
||||
{close, ClosingCode, ClosingReason}}) ->
|
||||
?LOG_DEBUG("Stream protocol reader received close command "
|
||||
"~tp ~tp",
|
||||
[ClosingCode, ClosingReason]),
|
||||
"~tp ~tp",
|
||||
[ClosingCode, ClosingReason]),
|
||||
Frame =
|
||||
rabbit_stream_core:frame({response, CorrelationId,
|
||||
{close, ?RESPONSE_CODE_OK}}),
|
||||
|
@ -2782,7 +2763,7 @@ handle_frame_post_auth(Transport,
|
|||
State,
|
||||
Command) ->
|
||||
?LOG_WARNING("unknown command ~tp, sending close command.",
|
||||
[Command]),
|
||||
[Command]),
|
||||
CloseReason = <<"unknown frame">>,
|
||||
Frame =
|
||||
rabbit_stream_core:frame({request, 1,
|
||||
|
@ -2844,17 +2825,15 @@ maybe_dispatch_on_subscription(Transport,
|
|||
SendFileOct,
|
||||
false = _Sac) ->
|
||||
?LOG_DEBUG("Distributing existing messages to subscription "
|
||||
"~tp on ~tp",
|
||||
[SubscriptionId, Stream]),
|
||||
"~tp on ~tp",
|
||||
[SubscriptionId, Stream]),
|
||||
case send_chunks(DeliverVersion,
|
||||
Transport,
|
||||
ConsumerState,
|
||||
SendFileOct)
|
||||
of
|
||||
{error, closed} ->
|
||||
?LOG_INFO("Stream protocol connection has been closed by "
|
||||
"peer",
|
||||
[]),
|
||||
?LOG_INFO("Stream protocol connection has been closed by peer", []),
|
||||
throw({stop, normal});
|
||||
{ok, #consumer{log = Log1, credit = Credit1} = ConsumerState1} ->
|
||||
Consumers1 = Consumers#{SubscriptionId => ConsumerState1},
|
||||
|
@ -2868,9 +2847,9 @@ maybe_dispatch_on_subscription(Transport,
|
|||
ConsumerOffsetLag = consumer_i(offset_lag, ConsumerState1),
|
||||
|
||||
?LOG_DEBUG("Subscription ~tp on ~tp is now at offset ~tp with ~tp "
|
||||
"message(s) distributed after subscription",
|
||||
[SubscriptionId, Stream, ConsumerOffset,
|
||||
messages_consumed(ConsumerCounters1)]),
|
||||
"message(s) distributed after subscription",
|
||||
[SubscriptionId, Stream, ConsumerOffset,
|
||||
messages_consumed(ConsumerCounters1)]),
|
||||
|
||||
rabbit_stream_metrics:consumer_created(self(),
|
||||
stream_r(Stream, Connection),
|
||||
|
@ -2895,9 +2874,9 @@ maybe_dispatch_on_subscription(_Transport,
|
|||
_SendFileOct,
|
||||
true = _Sac) ->
|
||||
?LOG_DEBUG("No initial dispatch for subscription ~tp for "
|
||||
"now, waiting for consumer update response from "
|
||||
"client (single active consumer)",
|
||||
[SubscriptionId]),
|
||||
"now, waiting for consumer update response from "
|
||||
"client (single active consumer)",
|
||||
[SubscriptionId]),
|
||||
#consumer{credit = Credit,
|
||||
configuration =
|
||||
#consumer_configuration{offset = Offset, active = Active}} =
|
||||
|
@ -3004,7 +2983,7 @@ handle_subscription(Transport,#stream_connection{
|
|||
State1};
|
||||
{error, Reason} ->
|
||||
?LOG_WARNING("Cannot create SAC subcription ~tp: ~tp",
|
||||
[SubscriptionId, Reason]),
|
||||
[SubscriptionId, Reason]),
|
||||
response(Transport,
|
||||
Connection,
|
||||
subscribe,
|
||||
|
@ -3041,7 +3020,7 @@ register_request(#stream_connection{outstanding_requests = Requests0,
|
|||
correlation_id_sequence = CorrIdSeq} = C,
|
||||
RequestContent) ->
|
||||
?LOG_DEBUG("Registering RPC request ~tp with correlation ID ~tp",
|
||||
[RequestContent, CorrIdSeq]),
|
||||
[RequestContent, CorrIdSeq]),
|
||||
|
||||
Requests1 = maps:put(CorrIdSeq, request(RequestContent), Requests0),
|
||||
|
||||
|
@ -3171,8 +3150,8 @@ maybe_unregister_consumer(VirtualHost,
|
|||
_ = sac_activate_consumer(VirtualHost, Stream,
|
||||
ConsumerName),
|
||||
?LOG_DEBUG("Outstanding SAC activation request for stream '~tp', " ++
|
||||
"group '~tp', sending activation.",
|
||||
[Stream, ConsumerName]),
|
||||
"group '~tp', sending activation.",
|
||||
[Stream, ConsumerName]),
|
||||
Acc;
|
||||
(K, V, Acc) ->
|
||||
Acc#{K => V}
|
||||
|
@ -3403,8 +3382,8 @@ store_offset(Reference, Stream, Offset, Connection0) ->
|
|||
case lookup_leader(Stream, Connection0) of
|
||||
{error, Error} ->
|
||||
?LOG_WARNING("Could not find leader to store offset on ~tp: "
|
||||
"~tp",
|
||||
[Stream, Error]),
|
||||
"~tp",
|
||||
[Stream, Error]),
|
||||
Connection0;
|
||||
{ClusterLeader, Connection1} ->
|
||||
osiris:write_tracking(ClusterLeader, Reference, Offset),
|
||||
|
@ -3447,7 +3426,7 @@ remove_subscription(SubscriptionId,
|
|||
configuration = #consumer_configuration{stream = Stream, member_pid = MemberPid}} =
|
||||
Consumer,
|
||||
?LOG_DEBUG("Deleting subscription ~tp (stream ~tp)",
|
||||
[SubscriptionId, Stream]),
|
||||
[SubscriptionId, Stream]),
|
||||
close_log(Log),
|
||||
#{Stream := SubscriptionsForThisStream} = StreamSubscriptions,
|
||||
SubscriptionsForThisStream1 =
|
||||
|
@ -4057,7 +4036,7 @@ sac_call(Call) ->
|
|||
Err;
|
||||
_ ->
|
||||
?LOG_INFO("Stream SAC coordinator call failed with ~tp",
|
||||
[Reason]),
|
||||
[Reason]),
|
||||
throw({stop, {shutdown, stream_sac_coordinator_error}})
|
||||
end;
|
||||
R ->
|
||||
|
|
|
@ -780,7 +780,7 @@ parse_request(<<?REQUEST:1,
|
|||
parse_map(Bin, #{});
|
||||
_ ->
|
||||
?LOG_WARNING("Incorrect binary for subscription properties: ~w",
|
||||
[PropsBin]),
|
||||
[PropsBin]),
|
||||
#{}
|
||||
end,
|
||||
request(CorrelationId,
|
||||
|
|
|
@ -185,6 +185,6 @@ ets_select(T, Spec) ->
|
|||
catch error:Reason ->
|
||||
%% badarg can occur if the table has no been created yet
|
||||
?LOG_WARNING("Error while querying ETS table '~tp': ~tp",
|
||||
[T, Reason]),
|
||||
[T, Reason]),
|
||||
[]
|
||||
end.
|
||||
|
|
|
@ -77,7 +77,7 @@ init(Args0) ->
|
|||
rabbit_tracing_traces:announce(VHost, Name, self()),
|
||||
Format = list_to_atom(binary_to_list(pget(format, Args))),
|
||||
?LOG_INFO("Tracer opened log file ~tp with "
|
||||
"format ~tp", [Filename, Format]),
|
||||
"format ~tp", [Filename, Format]),
|
||||
{ok, #state{conn = Conn, ch = Ch, vhost = VHost, queue = Q,
|
||||
file = F, filename = Filename,
|
||||
format = Format, buf = [], buf_cnt = 0,
|
||||
|
|
|
@ -43,7 +43,7 @@ file_info(Name) ->
|
|||
Info#file_info.size;
|
||||
{error, Error} ->
|
||||
?LOG_WARNING("error getting file info for ~ts: ~tp",
|
||||
[Name, Error]),
|
||||
[Name, Error]),
|
||||
0
|
||||
end,
|
||||
[{name, list_to_binary(Name)}, {size, Size}].
|
||||
|
|
|
@ -234,8 +234,8 @@ refresh_provider_certs(Provider, Config, ProviderState) ->
|
|||
NewProviderState;
|
||||
{error, Reason} ->
|
||||
?LOG_ERROR("Unable to load certificate list for provider ~tp,"
|
||||
" reason: ~tp",
|
||||
[Provider, Reason]),
|
||||
" reason: ~tp",
|
||||
[Provider, Reason]),
|
||||
ProviderState
|
||||
end.
|
||||
|
||||
|
@ -258,9 +258,9 @@ update_certs(CertsList, Provider, Config) ->
|
|||
save_cert(CertId, Provider, IssuerId, Cert, Name);
|
||||
{error, Reason} ->
|
||||
?LOG_ERROR("Unable to load CA certificate ~tp"
|
||||
" with provider ~tp,"
|
||||
" reason: ~tp",
|
||||
[CertId, Provider, Reason])
|
||||
" with provider ~tp,"
|
||||
" reason: ~tp",
|
||||
[CertId, Provider, Reason])
|
||||
end
|
||||
end,
|
||||
NewCertIds -- OldCertIds),
|
||||
|
@ -313,8 +313,8 @@ providers(Config) ->
|
|||
{module, Provider} -> true;
|
||||
{error, Error} ->
|
||||
?LOG_WARNING("Unable to load trust store certificates"
|
||||
" with provider module ~tp. Reason: ~tp",
|
||||
[Provider, Error]),
|
||||
" with provider module ~tp. Reason: ~tp",
|
||||
[Provider, Error]),
|
||||
false
|
||||
end
|
||||
end,
|
||||
|
@ -345,4 +345,3 @@ clean_deleted_providers(Providers) ->
|
|||
ets:fun2ms(fun(#entry{provider = P})-> true end),
|
||||
Condition = [ {'=/=', '$1', Provider} || Provider <- Providers ],
|
||||
ets:select_delete(table_name(), [{EntryMatch, Condition, [true]}]).
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ edit(Options) ->
|
|||
ok;
|
||||
Val ->
|
||||
?LOG_WARNING("RabbitMQ trust store plugin is used "
|
||||
"and the verify_fun TLS option is set: ~tp. "
|
||||
"It will be overwritten by the plugin.", [Val]),
|
||||
"and the verify_fun TLS option is set: ~tp. "
|
||||
"It will be overwritten by the plugin.", [Val]),
|
||||
ok
|
||||
end,
|
||||
%% Only enter those options neccessary for this application.
|
||||
|
|
|
@ -39,8 +39,7 @@ list_certs(Config, _) ->
|
|||
load_cert({FileName, _, _}, _, Config) ->
|
||||
Path = directory_path(Config),
|
||||
Cert = extract_cert(Path, FileName),
|
||||
?LOG_INFO(
|
||||
"trust store: loading certificate '~ts'", [FileName]),
|
||||
?LOG_INFO("trust store: loading certificate '~ts'", [FileName]),
|
||||
{ok, Cert}.
|
||||
|
||||
extract_cert(Path, FileName) ->
|
||||
|
|
|
@ -131,7 +131,7 @@ is_authorized(ReqData, Context, Username, Password, ErrorMsg, Fun, AuthConfig) -
|
|||
is_authorized(ReqData, Context, Username, Password, ErrorMsg, Fun, AuthConfig, ReplyWhenFailed) ->
|
||||
ErrFun = fun (ResolvedUserName, Msg) ->
|
||||
?LOG_WARNING("HTTP access denied: user '~ts' - ~ts",
|
||||
[ResolvedUserName, Msg]),
|
||||
[ResolvedUserName, Msg]),
|
||||
case ReplyWhenFailed of
|
||||
true -> not_authorised(Msg, ReqData, Context);
|
||||
false -> {false, ReqData, "Not_Authorized"}
|
||||
|
@ -173,7 +173,7 @@ is_authorized(ReqData, Context, Username, Password, ErrorMsg, Fun, AuthConfig, R
|
|||
{refused, _Username, Msg, Args} ->
|
||||
rabbit_core_metrics:auth_attempt_failed(IP, Username, http),
|
||||
?LOG_WARNING("HTTP access denied: ~ts",
|
||||
[rabbit_misc:format(Msg, Args)]),
|
||||
[rabbit_misc:format(Msg, Args)]),
|
||||
case ReplyWhenFailed of
|
||||
true -> not_authenticated(<<"Not_Authorized">>, ReqData, Context, AuthConfig);
|
||||
false -> {false, ReqData, "Not_Authorized"}
|
||||
|
|
|
@ -95,7 +95,7 @@ handle_call({remove, Name}, _From,
|
|||
case listener_by_name(Name) of
|
||||
{error, not_found} ->
|
||||
?LOG_WARNING("HTTP listener registry could not find context ~tp",
|
||||
[Name]),
|
||||
[Name]),
|
||||
{reply, ok, undefined};
|
||||
{ok, Listener} ->
|
||||
{ok, {Selectors, Fallback}} = lookup_dispatch(Listener),
|
||||
|
|
|
@ -120,7 +120,7 @@ start_tcp_listener(TCPConf0, CowboyOpts) ->
|
|||
end,
|
||||
listener_started(?TCP_PROTOCOL, TCPConf),
|
||||
?LOG_INFO("rabbit_web_mqtt: listening for HTTP connections on ~s:~w",
|
||||
[IpStr, Port]).
|
||||
[IpStr, Port]).
|
||||
|
||||
|
||||
start_tls_listener([], _) -> ok;
|
||||
|
@ -148,7 +148,7 @@ start_tls_listener(TLSConf0, CowboyOpts) ->
|
|||
end,
|
||||
listener_started(?TLS_PROTOCOL, TLSConf),
|
||||
?LOG_INFO("rabbit_web_mqtt: listening for HTTPS connections on ~s:~w",
|
||||
[TLSIpStr, TLSPort]).
|
||||
[TLSIpStr, TLSPort]).
|
||||
|
||||
listener_started(Protocol, Listener) ->
|
||||
Port = rabbit_misc:pget(port, Listener),
|
||||
|
|
|
@ -108,7 +108,7 @@ websocket_init(State) ->
|
|||
-spec close_connection(pid(), string()) -> 'ok'.
|
||||
close_connection(Pid, Reason) ->
|
||||
?LOG_INFO("Web STOMP: will terminate connection process ~tp, reason: ~ts",
|
||||
[Pid, Reason]),
|
||||
[Pid, Reason]),
|
||||
sys:terminate(Pid, Reason),
|
||||
ok.
|
||||
|
||||
|
@ -245,7 +245,7 @@ websocket_info(emit_stats, State) ->
|
|||
|
||||
websocket_info(Msg, State) ->
|
||||
?LOG_INFO("Web STOMP: unexpected message ~tp",
|
||||
[Msg]),
|
||||
[Msg]),
|
||||
{ok, State}.
|
||||
|
||||
terminate(_Reason, _Req, #state{proc_state = undefined}) ->
|
||||
|
|
Loading…
Reference in New Issue