From 1e17455463b6d9e483d8b3f4c790730ad8e873fc Mon Sep 17 00:00:00 2001 From: Michal Kuratczyk Date: Wed, 16 Jul 2025 00:06:29 +0200 Subject: [PATCH] [skip ci] Code formatting --- .../src/amqp10_client_connection.erl | 4 +- .../src/amqp10_client_frame_reader.erl | 10 ++-- .../src/amqp10_client_session.erl | 4 +- deps/amqp_client/src/amqp_channel.erl | 4 +- deps/amqp_client/src/amqp_gen_connection.erl | 4 +- deps/oauth2_client/src/oauth2_client.erl | 16 +++--- deps/rabbit/src/code_server_cache.erl | 2 +- deps/rabbit/src/mc_compat.erl | 4 +- deps/rabbit/src/pg_local.erl | 4 +- deps/rabbit/src/rabbit.erl | 2 +- deps/rabbit/src/rabbit_alarm.erl | 4 +- deps/rabbit/src/rabbit_amqp_filter_sql.erl | 10 ++-- deps/rabbit/src/rabbit_amqp_management.erl | 2 +- deps/rabbit/src/rabbit_amqqueue.erl | 8 +-- deps/rabbit/src/rabbit_amqqueue_sup_sup.erl | 4 +- .../src/rabbit_auth_backend_internal.erl | 12 ++--- deps/rabbit/src/rabbit_channel.erl | 8 +-- deps/rabbit/src/rabbit_channel_tracking.erl | 4 +- deps/rabbit/src/rabbit_classic_queue.erl | 8 +-- .../src/rabbit_classic_queue_index_v2.erl | 4 +- .../src/rabbit_classic_queue_store_v2.erl | 4 +- .../rabbit/src/rabbit_connection_tracking.erl | 10 ++-- .../src/rabbit_federation_link_util.erl | 20 ++++---- .../src/rabbit_shovel_worker.erl | 50 ++++++++++++------- 24 files changed, 109 insertions(+), 93 deletions(-) diff --git a/deps/amqp10_client/src/amqp10_client_connection.erl b/deps/amqp10_client/src/amqp10_client_connection.erl index d075c27e82..0ca030fafa 100644 --- a/deps/amqp10_client/src/amqp10_client_connection.erl +++ b/deps/amqp10_client/src/amqp10_client_connection.erl @@ -249,7 +249,7 @@ hdr_sent(_EvtType, {protocol_header_received, 0, 1, 0, 0}, State) -> hdr_sent(_EvtType, {protocol_header_received, Protocol, Maj, Min, Rev}, State) -> ?LOG_WARNING("Unsupported protocol version: ~b ~b.~b.~b", - [Protocol, Maj, Min, Rev]), + [Protocol, Maj, Min, Rev]), {stop, normal, State}; hdr_sent({call, From}, begin_session, #state{pending_session_reqs = PendingSessionReqs} = State) -> @@ -344,7 +344,7 @@ opened(info, {'DOWN', MRef, process, _, _Info}, {stop, normal}; opened(_EvtType, Frame, State) -> ?LOG_WARNING("Unexpected connection frame ~tp when in state ~tp ", - [Frame, State]), + [Frame, State]), keep_state_and_data. close_sent(_EvtType, heartbeat, _Data) -> diff --git a/deps/amqp10_client/src/amqp10_client_frame_reader.erl b/deps/amqp10_client/src/amqp10_client_frame_reader.erl index 93ccf464ac..d85af76b94 100644 --- a/deps/amqp10_client/src/amqp10_client_frame_reader.erl +++ b/deps/amqp10_client/src/amqp10_client_frame_reader.erl @@ -143,17 +143,17 @@ handle_event(info, {gun_ws, WsPid, StreamRef, WsFrame}, StateName, handle_socket_input(Bin, StateName, State); close -> ?LOG_INFO("peer closed AMQP over WebSocket connection in state '~s'", - [StateName]), + [StateName]), {stop, normal, socket_closed(State)}; {close, ReasonStatusCode, ReasonUtf8} -> ?LOG_INFO("peer closed AMQP over WebSocket connection in state '~s', reason: ~b ~ts", - [StateName, ReasonStatusCode, ReasonUtf8]), + [StateName, ReasonStatusCode, ReasonUtf8]), {stop, {shutdown, {ReasonStatusCode, ReasonUtf8}}, socket_closed(State)} end; handle_event(info, {TcpError, _Sock, Reason}, StateName, State) when TcpError == tcp_error orelse TcpError == ssl_error -> ?LOG_WARNING("AMQP 1.0 connection socket errored, connection state: '~ts', reason: '~tp'", - [StateName, Reason]), + [StateName, Reason]), {stop, {error, Reason}, socket_closed(State)}; handle_event(info, {TcpClosed, _}, StateName, State) when TcpClosed == tcp_closed orelse TcpClosed == ssl_closed -> @@ -163,12 +163,12 @@ handle_event(info, {TcpClosed, _}, StateName, State) handle_event(info, {gun_down, WsPid, _Proto, Reason, _Streams}, StateName, #state{socket = {ws, WsPid, _StreamRef}} = State) -> ?LOG_WARNING("AMQP over WebSocket process ~p lost connection in state: '~s': ~p", - [WsPid, StateName, Reason]), + [WsPid, StateName, Reason]), {stop, Reason, socket_closed(State)}; handle_event(info, {'DOWN', _Mref, process, WsPid, Reason}, StateName, #state{socket = {ws, WsPid, _StreamRef}} = State) -> ?LOG_WARNING("AMQP over WebSocket process ~p terminated in state: '~s': ~p", - [WsPid, StateName, Reason]), + [WsPid, StateName, Reason]), {stop, Reason, socket_closed(State)}; handle_event(info, heartbeat, _StateName, #state{connection = Connection}) -> diff --git a/deps/amqp10_client/src/amqp10_client_session.erl b/deps/amqp10_client/src/amqp10_client_session.erl index 08dd5e54de..df2d7564f5 100644 --- a/deps/amqp10_client/src/amqp10_client_session.erl +++ b/deps/amqp10_client/src/amqp10_client_session.erl @@ -487,7 +487,7 @@ mapped(cast, #'v1_0.disposition'{role = true, {keep_state, State#state{outgoing_unsettled = Unsettled}}; mapped(cast, Frame, State) -> ?LOG_WARNING("Unhandled session frame ~tp in state ~tp", - [Frame, State]), + [Frame, State]), {keep_state, State}; mapped({call, From}, {transfer, _Transfer, _Sections}, @@ -568,7 +568,7 @@ mapped({call, From}, Msg, State) -> mapped(_EvtType, Msg, _State) -> ?LOG_WARNING("amqp10_session: unhandled msg in mapped state ~W", - [Msg, 10]), + [Msg, 10]), keep_state_and_data. end_sent(_EvtType, #'v1_0.end'{} = End, State) -> diff --git a/deps/amqp_client/src/amqp_channel.erl b/deps/amqp_client/src/amqp_channel.erl index 06e9da7fc3..25203c73c7 100644 --- a/deps/amqp_client/src/amqp_channel.erl +++ b/deps/amqp_client/src/amqp_channel.erl @@ -781,8 +781,8 @@ handle_method_from_server1( State = #state{return_handler = ReturnHandler}) -> _ = case ReturnHandler of none -> ?LOG_WARNING("Channel (~tp): received {~tp, ~tp} but there is " - "no return handler registered", - [self(), BasicReturn, AmqpMsg]); + "no return handler registered", + [self(), BasicReturn, AmqpMsg]); {Pid, _Ref} -> Pid ! {BasicReturn, AmqpMsg} end, {noreply, State}; diff --git a/deps/amqp_client/src/amqp_gen_connection.erl b/deps/amqp_client/src/amqp_gen_connection.erl index 25596cc69a..5681845779 100644 --- a/deps/amqp_client/src/amqp_gen_connection.erl +++ b/deps/amqp_client/src/amqp_gen_connection.erl @@ -193,7 +193,7 @@ handle_cast({hard_error_in_channel, _Pid, Reason}, State) -> server_initiated_close(Reason, State); handle_cast({channel_internal_error, Pid, Reason}, State) -> ?LOG_WARNING("Connection (~tp) closing: internal error in channel (~tp): ~tp", - [self(), Pid, Reason]), + [self(), Pid, Reason]), internal_error(Pid, Reason, State); handle_cast({server_misbehaved, AmqpError}, State) -> server_misbehaved_close(AmqpError, State); @@ -324,7 +324,7 @@ server_initiated_close(Close, State) -> server_misbehaved_close(AmqpError, State) -> ?LOG_WARNING("Connection (~tp) closing: server misbehaved: ~tp", - [self(), AmqpError]), + [self(), AmqpError]), {0, Close} = rabbit_binary_generator:map_exception(0, AmqpError, ?PROTOCOL), set_closing_state(abrupt, #closing{reason = server_misbehaved, close = Close}, State). diff --git a/deps/oauth2_client/src/oauth2_client.erl b/deps/oauth2_client/src/oauth2_client.erl index 56bb085a8c..1aba46033d 100644 --- a/deps/oauth2_client/src/oauth2_client.erl +++ b/deps/oauth2_client/src/oauth2_client.erl @@ -24,7 +24,7 @@ {error, unsuccessful_access_token_response() | any()}. get_access_token(OAuthProvider, Request) -> ?LOG_DEBUG("get_access_token using OAuthProvider:~p and client_id:~p", - [OAuthProvider, Request#access_token_request.client_id]), + [OAuthProvider, Request#access_token_request.client_id]), URL = OAuthProvider#oauth_provider.token_endpoint, Header = [], Type = ?CONTENT_URLENCODED, @@ -221,7 +221,7 @@ do_update_oauth_provider_endpoints_configuration(OAuthProvider) when JwksUri -> set_env(jwks_uri, JwksUri) end, ?LOG_DEBUG("Updated oauth_provider details: ~p ", - [format_oauth_provider(OAuthProvider)]), + [format_oauth_provider(OAuthProvider)]), OAuthProvider; do_update_oauth_provider_endpoints_configuration(OAuthProvider) -> @@ -273,7 +273,7 @@ get_oauth_provider(ListOfRequiredAttributes) -> undefined -> get_root_oauth_provider(ListOfRequiredAttributes); DefaultOauthProviderId -> ?LOG_DEBUG("Using default_oauth_provider ~p", - [DefaultOauthProviderId]), + [DefaultOauthProviderId]), get_oauth_provider(DefaultOauthProviderId, ListOfRequiredAttributes) end. @@ -296,7 +296,7 @@ ensure_oauth_provider_has_attributes(OAuthProvider, ListOfRequiredAttributes) -> case find_missing_attributes(OAuthProvider, ListOfRequiredAttributes) of [] -> ?LOG_DEBUG("Resolved oauth_provider ~p", - [format_oauth_provider(OAuthProvider)]), + [format_oauth_provider(OAuthProvider)]), {ok, OAuthProvider}; _ = Attrs -> {error, {missing_oauth_provider_attributes, Attrs}} @@ -305,13 +305,13 @@ ensure_oauth_provider_has_attributes(OAuthProvider, ListOfRequiredAttributes) -> get_root_oauth_provider(ListOfRequiredAttributes) -> OAuthProvider = lookup_root_oauth_provider(), ?LOG_DEBUG("Using root oauth_provider ~p", - [format_oauth_provider(OAuthProvider)]), + [format_oauth_provider(OAuthProvider)]), case find_missing_attributes(OAuthProvider, ListOfRequiredAttributes) of [] -> {ok, OAuthProvider}; _ = MissingAttributes -> ?LOG_DEBUG("Looking up missing attributes ~p ...", - [MissingAttributes]), + [MissingAttributes]), case download_oauth_provider(OAuthProvider) of {ok, OAuthProvider2} -> ensure_oauth_provider_has_attributes(OAuthProvider2, @@ -335,11 +335,11 @@ get_oauth_provider(OAuth2ProviderId, ListOfRequiredAttributes) get_oauth_provider(OAuthProviderId, ListOfRequiredAttributes) when is_binary(OAuthProviderId) -> ?LOG_DEBUG("get_oauth_provider ~p with at least these attributes: ~p", - [OAuthProviderId, ListOfRequiredAttributes]), + [OAuthProviderId, ListOfRequiredAttributes]), case lookup_oauth_provider_config(OAuthProviderId) of {error, _} = Error0 -> ?LOG_DEBUG("Failed to find oauth_provider ~p configuration due to ~p", - [OAuthProviderId, Error0]), + [OAuthProviderId, Error0]), Error0; Config -> ?LOG_DEBUG("Found oauth_provider configuration ~p", [Config]), diff --git a/deps/rabbit/src/code_server_cache.erl b/deps/rabbit/src/code_server_cache.erl index f9e516bbef..3d3f750ad6 100644 --- a/deps/rabbit/src/code_server_cache.erl +++ b/deps/rabbit/src/code_server_cache.erl @@ -73,7 +73,7 @@ handle_maybe_call_mfa(true, {Module, Function, Args, Default}, State) -> handle_maybe_call_mfa_error(Module, Default, State); Err:Reason -> ?LOG_ERROR("Calling ~tp:~tp failed: ~tp:~tp", - [Module, Function, Err, Reason]), + [Module, Function, Err, Reason]), handle_maybe_call_mfa_error(Module, Default, State) end. diff --git a/deps/rabbit/src/mc_compat.erl b/deps/rabbit/src/mc_compat.erl index 1f11bc4bfe..f501327c4b 100644 --- a/deps/rabbit/src/mc_compat.erl +++ b/deps/rabbit/src/mc_compat.erl @@ -269,8 +269,8 @@ update_x_death_header(Info, Headers) -> [{table, rabbit_misc:sort_field_table(Info1)} | Others]); {<<"x-death">>, InvalidType, Header} -> ?LOG_WARNING("Message has invalid x-death header (type: ~tp)." - " Resetting header ~tp", - [InvalidType, Header]), + " Resetting header ~tp", + [InvalidType, Header]), %% if x-death is something other than an array (list) %% then we reset it: this happens when some clients consume %% a message and re-publish is, converting header values diff --git a/deps/rabbit/src/pg_local.erl b/deps/rabbit/src/pg_local.erl index c3e019954b..6397ea69a5 100644 --- a/deps/rabbit/src/pg_local.erl +++ b/deps/rabbit/src/pg_local.erl @@ -123,8 +123,8 @@ handle_call(clear, _From, S) -> handle_call(Request, From, S) -> ?LOG_WARNING("The pg_local server received an unexpected message:\n" - "handle_call(~tp, ~tp, _)\n", - [Request, From]), + "handle_call(~tp, ~tp, _)\n", + [Request, From]), {noreply, S}. handle_cast({join, Name, Pid}, S) -> diff --git a/deps/rabbit/src/rabbit.erl b/deps/rabbit/src/rabbit.erl index 86e74f763f..6224c70127 100644 --- a/deps/rabbit/src/rabbit.erl +++ b/deps/rabbit/src/rabbit.erl @@ -1155,7 +1155,7 @@ pg_local_scope(Prefix) -> update_cluster_tags() -> Tags = application:get_env(rabbit, cluster_tags, []), ?LOG_DEBUG("Seeding cluster tags from application environment key...", - #{domain => ?RMQLOG_DOMAIN_GLOBAL}), + #{domain => ?RMQLOG_DOMAIN_GLOBAL}), rabbit_runtime_parameters:set_global(cluster_tags, Tags, <<"internal_user">>). diff --git a/deps/rabbit/src/rabbit_alarm.erl b/deps/rabbit/src/rabbit_alarm.erl index 969e614f4a..879fdae818 100644 --- a/deps/rabbit/src/rabbit_alarm.erl +++ b/deps/rabbit/src/rabbit_alarm.erl @@ -242,7 +242,7 @@ handle_event({node_down, Node}, #alarms{alarmed_nodes = AN} = State) -> end, {ok, lists:foldr(fun(Source, AccState) -> ?LOG_WARNING("~ts resource limit alarm cleared for dead node ~tp", - [Source, Node]), + [Source, Node]), maybe_alert(fun dict_unappend/3, Node, Source, false, AccState) end, State, AlarmsForDeadNode)}; @@ -350,7 +350,7 @@ handle_set_alarm(Alarm, State) -> handle_clear_resource_alarm(Source, Node, State) -> ?LOG_WARNING("~ts resource limit alarm cleared on node ~tp", - [Source, Node]), + [Source, Node]), {ok, maybe_alert(fun dict_unappend/3, Node, Source, false, State)}. handle_clear_alarm(file_descriptor_limit, State) -> diff --git a/deps/rabbit/src/rabbit_amqp_filter_sql.erl b/deps/rabbit/src/rabbit_amqp_filter_sql.erl index 25341719dc..e1a34ec007 100644 --- a/deps/rabbit/src/rabbit_amqp_filter_sql.erl +++ b/deps/rabbit/src/rabbit_amqp_filter_sql.erl @@ -295,14 +295,14 @@ sql_to_list(SQL) -> {ok, String}; Error -> ?LOG_WARNING("JMS message selector ~p is not UTF-8 encoded: ~p", - [JmsSelector, Error]), + [JmsSelector, Error]), error end. check_length(String) when length(String) > ?MAX_EXPRESSION_LENGTH -> ?LOG_WARNING("JMS message selector length ~b exceeds maximum length ~b", - [length(String), ?MAX_EXPRESSION_LENGTH]), + [length(String), ?MAX_EXPRESSION_LENGTH]), error; check_length(_) -> ok. @@ -313,14 +313,14 @@ tokenize(String, SQL) -> {ok, Tokens}; {error, {_Line, _Mod, ErrDescriptor}, _Location} -> ?LOG_WARNING("failed to scan JMS message selector '~ts': ~tp", - [JmsSelector, ErrDescriptor]), + [JmsSelector, ErrDescriptor]), error end. check_token_count(Tokens, SQL) when length(Tokens) > ?MAX_TOKENS -> ?LOG_WARNING("JMS message selector '~ts' with ~b tokens exceeds token limit ~b", - [JmsSelector, length(Tokens), ?MAX_TOKENS]), + [JmsSelector, length(Tokens), ?MAX_TOKENS]), error; check_token_count(_, _) -> ok. @@ -329,7 +329,7 @@ parse(Tokens, SQL) -> case rabbit_amqp_sql_parser:parse(Tokens) of {error, Reason} -> ?LOG_WARNING("failed to parse JMS message selector '~ts': ~p", - [JmsSelector, Reason]), + [JmsSelector, Reason]), error; Ok -> Ok diff --git a/deps/rabbit/src/rabbit_amqp_management.erl b/deps/rabbit/src/rabbit_amqp_management.erl index 7769c7c732..dde44bb7d9 100644 --- a/deps/rabbit/src/rabbit_amqp_management.erl +++ b/deps/rabbit/src/rabbit_amqp_management.erl @@ -51,7 +51,7 @@ handle_request(Request, Vhost, User, ConnectionPid, PermCaches0) -> PermCaches0) catch throw:{?MODULE, StatusCode0, Explanation} -> ?LOG_WARNING("request ~ts ~ts failed: ~ts", - [HttpMethod, HttpRequestTarget, Explanation]), + [HttpMethod, HttpRequestTarget, Explanation]), {StatusCode0, {utf8, Explanation}, PermCaches0} end, diff --git a/deps/rabbit/src/rabbit_amqqueue.erl b/deps/rabbit/src/rabbit_amqqueue.erl index 041cb52cc7..3bb8f53f3b 100644 --- a/deps/rabbit/src/rabbit_amqqueue.erl +++ b/deps/rabbit/src/rabbit_amqqueue.erl @@ -425,7 +425,7 @@ rebalance(Type, VhostSpec, QueueSpec) -> %% filtered out with is_replicable(Q). Maybe error instead? maybe_rebalance({true, Id}, Type, VhostSpec, QueueSpec) -> ?LOG_INFO("Starting queue rebalance operation: '~ts' for vhosts matching '~ts' and queues matching '~ts'", - [Type, VhostSpec, QueueSpec]), + [Type, VhostSpec, QueueSpec]), Running = rabbit_maintenance:filter_out_drained_nodes_consistent_read(rabbit_nodes:list_running()), NumRunning = length(Running), TypeModule = case Type of @@ -523,7 +523,7 @@ maybe_migrate(ByNode, MaxQueuesDesired, [N | Nodes]) -> _ -> [{Length, Destination} | _] = sort_by_number_of_queues(Candidates, ByNode), ?LOG_INFO("Migrating queue ~tp from node ~tp with ~tp queues to node ~tp with ~tp queues", - [Name, N, length(All), Destination, Length]), + [Name, N, length(All), Destination, Length]), case Module:transfer_leadership(Q, Destination) of {migrated, NewNode} -> ?LOG_INFO("Queue ~tp migrated to ~tp", [Name, NewNode]), @@ -1982,8 +1982,8 @@ delete_transient_queues_on_node(Node) -> case length(QueueNames) of 0 -> ok; N -> ?LOG_INFO("~b transient queues from node '~ts' " - "deleted in ~fs", - [N, Node, Time / 1_000_000]) + "deleted in ~fs", + [N, Node, Time / 1_000_000]) end, notify_queue_binding_deletions(Deletions), rabbit_core_metrics:queues_deleted(QueueNames), diff --git a/deps/rabbit/src/rabbit_amqqueue_sup_sup.erl b/deps/rabbit/src/rabbit_amqqueue_sup_sup.erl index e7cba35f59..1394a51878 100644 --- a/deps/rabbit/src/rabbit_amqqueue_sup_sup.erl +++ b/deps/rabbit/src/rabbit_amqqueue_sup_sup.erl @@ -76,7 +76,7 @@ start_for_vhost(VHost) -> %% e.g. some integration tests do it {error, {no_such_vhost, VHost}} -> ?LOG_ERROR("Failed to start a queue process supervisor for vhost ~ts: vhost no longer exists!", - [VHost]), + [VHost]), {error, {no_such_vhost, VHost}} end. @@ -89,6 +89,6 @@ stop_for_vhost(VHost) -> %% see start/1 {error, {no_such_vhost, VHost}} -> ?LOG_ERROR("Failed to stop a queue process supervisor for vhost ~ts: vhost no longer exists!", - [VHost]), + [VHost]), ok end. diff --git a/deps/rabbit/src/rabbit_auth_backend_internal.erl b/deps/rabbit/src/rabbit_auth_backend_internal.erl index 4b658f7794..09bf96f6a1 100644 --- a/deps/rabbit/src/rabbit_auth_backend_internal.erl +++ b/deps/rabbit/src/rabbit_auth_backend_internal.erl @@ -526,11 +526,11 @@ set_permissions(Username, VirtualHost, ConfigurePerm, WritePerm, ReadPerm, Actin clear_permissions(Username, VirtualHost, ActingUser) -> ?LOG_DEBUG("Asked to clear permissions for user '~ts' in virtual host '~ts'", - [Username, VirtualHost]), + [Username, VirtualHost]), try R = rabbit_db_user:clear_user_permissions(Username, VirtualHost), ?LOG_INFO("Successfully cleared permissions for user '~ts' in virtual host '~ts'", - [Username, VirtualHost]), + [Username, VirtualHost]), rabbit_event:notify(permission_deleted, [{user, Username}, {vhost, VirtualHost}, {user_who_performed_action, ActingUser}]), @@ -636,11 +636,11 @@ set_topic_permissions(Username, VirtualHost, Exchange, WritePerm, ReadPerm, Acti clear_topic_permissions(Username, VirtualHost, ActingUser) -> ?LOG_DEBUG("Asked to clear topic permissions for user '~ts' in virtual host '~ts'", - [Username, VirtualHost]), + [Username, VirtualHost]), try R = rabbit_db_user:clear_topic_permissions(Username, VirtualHost, '_'), ?LOG_INFO("Successfully cleared topic permissions for user '~ts' in virtual host '~ts'", - [Username, VirtualHost]), + [Username, VirtualHost]), rabbit_event:notify(topic_permission_deleted, [{user, Username}, {vhost, VirtualHost}, {user_who_performed_action, ActingUser}]), @@ -654,12 +654,12 @@ clear_topic_permissions(Username, VirtualHost, ActingUser) -> clear_topic_permissions(Username, VirtualHost, Exchange, ActingUser) -> ?LOG_DEBUG("Asked to clear topic permissions on exchange '~ts' for user '~ts' in virtual host '~ts'", - [Exchange, Username, VirtualHost]), + [Exchange, Username, VirtualHost]), try R = rabbit_db_user:clear_topic_permissions( Username, VirtualHost, Exchange), ?LOG_INFO("Successfully cleared topic permissions on exchange '~ts' for user '~ts' in virtual host '~ts'", - [Exchange, Username, VirtualHost]), + [Exchange, Username, VirtualHost]), rabbit_event:notify(topic_permission_deleted, [{user, Username}, {vhost, VirtualHost}, {user_who_performed_action, ActingUser}]), diff --git a/deps/rabbit/src/rabbit_channel.erl b/deps/rabbit/src/rabbit_channel.erl index 649270bc7d..6ee0dec45d 100644 --- a/deps/rabbit/src/rabbit_channel.erl +++ b/deps/rabbit/src/rabbit_channel.erl @@ -414,8 +414,8 @@ refresh_config_local() -> gen_server2:call(C, refresh_config, infinity) catch _:Reason -> ?LOG_ERROR("Failed to refresh channel config " - "for channel ~tp. Reason ~tp", - [C, Reason]) + "for channel ~tp. Reason ~tp", + [C, Reason]) end end, list_local()), @@ -428,8 +428,8 @@ refresh_interceptors() -> gen_server2:call(C, refresh_interceptors, ?REFRESH_TIMEOUT) catch _:Reason -> ?LOG_ERROR("Failed to refresh channel interceptors " - "for channel ~tp. Reason ~tp", - [C, Reason]) + "for channel ~tp. Reason ~tp", + [C, Reason]) end end, list_local()), diff --git a/deps/rabbit/src/rabbit_channel_tracking.erl b/deps/rabbit/src/rabbit_channel_tracking.erl index 1c4ede34fe..7843d9a3c4 100644 --- a/deps/rabbit/src/rabbit_channel_tracking.erl +++ b/deps/rabbit/src/rabbit_channel_tracking.erl @@ -219,13 +219,13 @@ ensure_tracked_tables_for_this_node() -> %% Create tables ensure_tracked_channels_table_for_this_node() -> ?LOG_INFO("Setting up a table for channel tracking on this node: ~tp", - [?TRACKED_CHANNEL_TABLE]), + [?TRACKED_CHANNEL_TABLE]), ets:new(?TRACKED_CHANNEL_TABLE, [named_table, public, {write_concurrency, true}, {keypos, #tracked_channel.pid}]). ensure_per_user_tracked_channels_table_for_this_node() -> ?LOG_INFO("Setting up a table for channel tracking on this node: ~tp", - [?TRACKED_CHANNEL_TABLE_PER_USER]), + [?TRACKED_CHANNEL_TABLE_PER_USER]), ets:new(?TRACKED_CHANNEL_TABLE_PER_USER, [named_table, public, {write_concurrency, true}]). get_tracked_channels_by_connection_pid(ConnPid) -> diff --git a/deps/rabbit/src/rabbit_classic_queue.erl b/deps/rabbit/src/rabbit_classic_queue.erl index 125a95173a..ed7c5619d5 100644 --- a/deps/rabbit/src/rabbit_classic_queue.erl +++ b/deps/rabbit/src/rabbit_classic_queue.erl @@ -179,9 +179,9 @@ delete(Q0, IfUnused, IfEmpty, ActingUser) when ?amqqueue_is_classic(Q0) -> case IfEmpty of true -> ?LOG_ERROR("Queue ~ts in vhost ~ts is down. " - "The queue may be non-empty. " - "Refusing to force-delete.", - [Name, Vhost]), + "The queue may be non-empty. " + "Refusing to force-delete.", + [Name, Vhost]), {error, not_empty}; false -> ?LOG_WARNING("Queue ~ts in vhost ~ts is down. " @@ -590,7 +590,7 @@ recover_durable_queues(QueuesAndRecoveryTerms) -> [{rabbit_amqqueue_sup_sup:start_queue_process(node(), Q), {init, {self(), Terms}}} || {Q, Terms} <- QueuesAndRecoveryTerms]), _ = [?LOG_ERROR("Queue ~tp failed to initialise: ~tp", - [Pid, Error]) || {Pid, Error} <- Failures], + [Pid, Error]) || {Pid, Error} <- Failures], [Q || {_, {new, Q}} <- Results]. capabilities() -> diff --git a/deps/rabbit/src/rabbit_classic_queue_index_v2.erl b/deps/rabbit/src/rabbit_classic_queue_index_v2.erl index 855b77e635..7d6fa3de8a 100644 --- a/deps/rabbit/src/rabbit_classic_queue_index_v2.erl +++ b/deps/rabbit/src/rabbit_classic_queue_index_v2.erl @@ -447,7 +447,7 @@ recover_index_v1_clean(State0 = #qi{ queue_name = Name }, Terms, IsMsgStoreClean CountersRef = counters:new(?RECOVER_COUNTER_SIZE, []), State = recover_index_v1_common(State0, V1State, CountersRef), ?LOG_INFO("Queue ~ts in vhost ~ts converted ~b total messages from v1 to v2", - [QName, VHost, counters:get(CountersRef, ?RECOVER_COUNT)]), + [QName, VHost, counters:get(CountersRef, ?RECOVER_COUNT)]), State. recover_index_v1_dirty(State0 = #qi{ queue_name = Name }, Terms, IsMsgStoreClean, @@ -466,7 +466,7 @@ recover_index_v1_dirty(State0 = #qi{ queue_name = Name }, Terms, IsMsgStoreClean convert), State = recover_index_v1_common(State0, V1State, CountersRef), ?LOG_INFO("Queue ~ts in vhost ~ts converted ~b total messages from v1 to v2", - [QName, VHost, counters:get(CountersRef, ?RECOVER_COUNT)]), + [QName, VHost, counters:get(CountersRef, ?RECOVER_COUNT)]), State. %% At this point all messages are persistent because transient messages diff --git a/deps/rabbit/src/rabbit_classic_queue_store_v2.erl b/deps/rabbit/src/rabbit_classic_queue_store_v2.erl index d324acf26f..9e27c7c251 100644 --- a/deps/rabbit/src/rabbit_classic_queue_store_v2.erl +++ b/deps/rabbit/src/rabbit_classic_queue_store_v2.erl @@ -319,7 +319,7 @@ read_from_disk(SeqId, {?MODULE, Offset, Size}, State0) -> ok catch C:E:S -> ?LOG_ERROR("Per-queue store CRC32 check failed in ~ts seq id ~b offset ~b size ~b", - [segment_file(Segment, State), SeqId, Offset, Size]), + [segment_file(Segment, State), SeqId, Offset, Size]), erlang:raise(C, E, S) end end, @@ -417,7 +417,7 @@ parse_many_from_disk([< ?LOG_ERROR("Per-queue store CRC32 check failed in ~ts", - [segment_file(Segment, State)]), + [segment_file(Segment, State)]), erlang:raise(C, E, S) end end, diff --git a/deps/rabbit/src/rabbit_connection_tracking.erl b/deps/rabbit/src/rabbit_connection_tracking.erl index f38e982451..74ae63ece8 100644 --- a/deps/rabbit/src/rabbit_connection_tracking.erl +++ b/deps/rabbit/src/rabbit_connection_tracking.erl @@ -118,8 +118,8 @@ handle_cast({vhost_down, Details}) -> VHost = pget(name, Details), Node = pget(node, Details), ?LOG_INFO("Closing all connections in vhost '~ts' on node '~ts'" - " because the vhost is stopping", - [VHost, Node]), + " because the vhost is stopping", + [VHost, Node]), shutdown_tracked_items( list_on_node(Node, VHost), rabbit_misc:format("vhost '~ts' is down", [VHost])); @@ -191,17 +191,17 @@ ensure_tracked_connections_table_for_this_node() -> _ = ets:new(?TRACKED_CONNECTION_TABLE, [named_table, public, {write_concurrency, true}, {keypos, #tracked_connection.id}]), ?LOG_INFO("Setting up a table for connection tracking on this node: ~tp", - [?TRACKED_CONNECTION_TABLE]). + [?TRACKED_CONNECTION_TABLE]). ensure_per_vhost_tracked_connections_table_for_this_node() -> ?LOG_INFO("Setting up a table for per-vhost connection counting on this node: ~tp", - [?TRACKED_CONNECTION_TABLE_PER_VHOST]), + [?TRACKED_CONNECTION_TABLE_PER_VHOST]), ets:new(?TRACKED_CONNECTION_TABLE_PER_VHOST, [named_table, public, {write_concurrency, true}]). ensure_per_user_tracked_connections_table_for_this_node() -> _ = ets:new(?TRACKED_CONNECTION_TABLE_PER_USER, [named_table, public, {write_concurrency, true}]), ?LOG_INFO("Setting up a table for per-user connection counting on this node: ~tp", - [?TRACKED_CONNECTION_TABLE_PER_USER]). + [?TRACKED_CONNECTION_TABLE_PER_USER]). -spec tracked_connection_table_name_for(node()) -> atom(). diff --git a/deps/rabbitmq_federation_common/src/rabbit_federation_link_util.erl b/deps/rabbitmq_federation_common/src/rabbit_federation_link_util.erl index e2d72d38a6..b42cb731bf 100644 --- a/deps/rabbitmq_federation_common/src/rabbit_federation_link_util.erl +++ b/deps/rabbitmq_federation_common/src/rabbit_federation_link_util.erl @@ -56,8 +56,8 @@ start_conn_ch(Fun, OUpstream, OUParams, try R = Fun(Conn, Ch, DConn, DCh), ?LOG_INFO("Federation ~ts connected to ~ts", - [rabbit_misc:rs(XorQName), - rabbit_federation_upstream:params_to_string(UParams)]), + [rabbit_misc:rs(XorQName), + rabbit_federation_upstream:params_to_string(UParams)]), Name = pget(name, amqp_connection:info(DConn, [name])), rabbit_federation_status:report( OUpstream, OUParams, XorQName, {running, Name}), @@ -130,31 +130,31 @@ connection_error(remote_start, {{shutdown, {server_initiated_close, Code, Messag rabbit_federation_status:report( Upstream, UParams, XorQName, clean_reason(E)), ?LOG_WARNING("Federation ~ts did not connect to ~ts. Server has closed the connection due to an error, code: ~tp, " - "message: ~ts", - [rabbit_misc:rs(XorQName), rabbit_federation_upstream:params_to_string(UParams), - Code, Message]), + "message: ~ts", + [rabbit_misc:rs(XorQName), rabbit_federation_upstream:params_to_string(UParams), + Code, Message]), {stop, {shutdown, restart}, State}; connection_error(remote_start, E, Upstream, UParams, XorQName, State) -> rabbit_federation_status:report( Upstream, UParams, XorQName, clean_reason(E)), ?LOG_WARNING("Federation ~ts did not connect to ~ts. Reason: ~tp", - [rabbit_misc:rs(XorQName), rabbit_federation_upstream:params_to_string(UParams), - E]), + [rabbit_misc:rs(XorQName), rabbit_federation_upstream:params_to_string(UParams), + E]), {stop, {shutdown, restart}, State}; connection_error(remote, E, Upstream, UParams, XorQName, State) -> rabbit_federation_status:report( Upstream, UParams, XorQName, clean_reason(E)), ?LOG_INFO("Federation ~ts disconnected from ~ts~n~tp", - [rabbit_misc:rs(XorQName), rabbit_federation_upstream:params_to_string(UParams), E]), + [rabbit_misc:rs(XorQName), rabbit_federation_upstream:params_to_string(UParams), E]), {stop, {shutdown, restart}, State}; connection_error(command_channel, E, Upstream, UParams, XorQName, State) -> rabbit_federation_status:report( Upstream, UParams, XorQName, clean_reason(E)), ?LOG_INFO("Federation ~ts failed to open a command channel for upstream ~ts~n~tp", - [rabbit_misc:rs(XorQName), rabbit_federation_upstream:params_to_string(UParams), E]), + [rabbit_misc:rs(XorQName), rabbit_federation_upstream:params_to_string(UParams), E]), {stop, {shutdown, restart}, State}; connection_error(local, basic_cancel, Upstream, UParams, XorQName, State) -> @@ -284,7 +284,7 @@ log_terminate(shutdown, Upstream, UParams, XorQName) -> %% nicely so that we do not cause unacked messages to be %% redelivered. ?LOG_INFO("disconnecting from ~ts", - [rabbit_federation_upstream:params_to_string(UParams)]), + [rabbit_federation_upstream:params_to_string(UParams)]), rabbit_federation_status:remove(Upstream, XorQName); log_terminate(Reason, Upstream, UParams, XorQName) -> diff --git a/deps/rabbitmq_shovel/src/rabbit_shovel_worker.erl b/deps/rabbitmq_shovel/src/rabbit_shovel_worker.erl index 6ea948dee1..368bb60ec6 100644 --- a/deps/rabbitmq_shovel/src/rabbit_shovel_worker.erl +++ b/deps/rabbitmq_shovel/src/rabbit_shovel_worker.erl @@ -77,7 +77,8 @@ handle_cast(init, State = #state{config = Config0}) -> gen_server2:cast(self(), connect_dest), {noreply, State#state{config = Config}} catch E:R -> - ?LOG_ERROR("Shovel ~ts could not connect to source: ~p ~p", [human_readable_name(maps:get(name, Config0)), E, R]), + ?LOG_ERROR("Shovel ~ts could not connect to source: ~p ~p", + [human_readable_name(maps:get(name, Config0)), E, R]), {stop, shutdown, State} end; handle_cast(connect_dest, State = #state{config = Config0}) -> @@ -87,7 +88,8 @@ handle_cast(connect_dest, State = #state{config = Config0}) -> gen_server2:cast(self(), init_shovel), {noreply, State#state{config = Config}} catch E:R -> - ?LOG_ERROR("Shovel ~ts could not connect to destination: ~p ~p", [human_readable_name(maps:get(name, Config0)), E, R]), + ?LOG_ERROR("Shovel ~ts could not connect to destination: ~p ~p", + [human_readable_name(maps:get(name, Config0)), E, R]), {stop, shutdown, State} end; handle_cast(init_shovel, State = #state{config = Config}) -> @@ -97,7 +99,8 @@ handle_cast(init_shovel, State = #state{config = Config}) -> process_flag(trap_exit, true), Config1 = rabbit_shovel_behaviour:init_dest(Config), Config2 = rabbit_shovel_behaviour:init_source(Config1), - ?LOG_DEBUG("Shovel ~ts has finished setting up its topology", [human_readable_name(maps:get(name, Config2))]), + ?LOG_DEBUG("Shovel ~ts has finished setting up its topology", + [human_readable_name(maps:get(name, Config2))]), State1 = State#state{config = Config2}, ok = report_running(State1), {noreply, State1}. @@ -108,19 +111,24 @@ handle_info(Msg, State = #state{config = Config, name = Name}) -> not_handled -> case rabbit_shovel_behaviour:handle_dest(Msg, Config) of not_handled -> - ?LOG_WARNING("Shovel ~ts could not handle a destination message ~tp", [human_readable_name(Name), Msg]), + ?LOG_WARNING("Shovel ~ts could not handle a destination message ~tp", + [human_readable_name(Name), Msg]), {noreply, State}; {stop, {outbound_conn_died, heartbeat_timeout}} -> - ?LOG_ERROR("Shovel ~ts detected missed heartbeats on destination connection", [human_readable_name(Name)]), + ?LOG_ERROR("Shovel ~ts detected missed heartbeats on destination connection", + [human_readable_name(Name)]), {stop, {shutdown, heartbeat_timeout}, State}; {stop, {outbound_conn_died, Reason}} -> - ?LOG_ERROR("Shovel ~ts detected destination connection failure: ~tp", [human_readable_name(Name), Reason]), + ?LOG_ERROR("Shovel ~ts detected destination connection failure: ~tp", + [human_readable_name(Name), Reason]), {stop, Reason, State}; {stop, {outbound_link_or_channel_closure, Reason}} -> - ?LOG_ERROR("Shovel ~ts detected destination shovel failure: ~tp", [human_readable_name(Name), Reason]), + ?LOG_ERROR("Shovel ~ts detected destination shovel failure: ~tp", + [human_readable_name(Name), Reason]), {stop, Reason, State}; {stop, Reason} -> - ?LOG_DEBUG("Shovel ~ts decided to stop due a message from destination: ~tp", [human_readable_name(Name), Reason]), + ?LOG_DEBUG("Shovel ~ts decided to stop due a message from destination: ~tp", + [human_readable_name(Name), Reason]), {stop, Reason, State}; Config1 -> State1 = State#state{config = Config1}, @@ -128,16 +136,20 @@ handle_info(Msg, State = #state{config = Config, name = Name}) -> {noreply, State2} end; {stop, {inbound_conn_died, heartbeat_timeout}} -> - ?LOG_ERROR("Shovel ~ts detected missed heartbeats on source connection", [human_readable_name(Name)]), + ?LOG_ERROR("Shovel ~ts detected missed heartbeats on source connection", + [human_readable_name(Name)]), {stop, {shutdown, heartbeat_timeout}, State}; {stop, {inbound_conn_died, Reason}} -> - ?LOG_ERROR("Shovel ~ts detected source connection failure: ~tp", [human_readable_name(Name), Reason]), + ?LOG_ERROR("Shovel ~ts detected source connection failure: ~tp", + [human_readable_name(Name), Reason]), {stop, Reason, State}; {stop, {inbound_link_or_channel_closure, Reason}} -> - ?LOG_ERROR("Shovel ~ts detected source Shovel (or link, or channel) failure: ~tp", [human_readable_name(Name), Reason]), + ?LOG_ERROR("Shovel ~ts detected source Shovel (or link, or channel) failure: ~tp", + [human_readable_name(Name), Reason]), {stop, Reason, State}; {stop, Reason} -> - ?LOG_ERROR("Shovel ~ts decided to stop due a message from source: ~tp", [human_readable_name(Name), Reason]), + ?LOG_ERROR("Shovel ~ts decided to stop due a message from source: ~tp", + [human_readable_name(Name), Reason]), {stop, Reason, State}; Config1 -> State1 = State#state{config = Config1}, @@ -149,7 +161,7 @@ terminate({shutdown, autodelete}, State = #state{name = Name, type = dynamic}) -> {VHost, ShovelName} = Name, ?LOG_INFO("Shovel '~ts' is stopping (it was configured to autodelete and transfer is completed)", - [human_readable_name(Name)]), + [human_readable_name(Name)]), close_connections(State), %% See rabbit_shovel_dyn_worker_sup_sup:stop_child/1 put({shovel_worker_autodelete, Name}, true), @@ -161,25 +173,29 @@ terminate(shutdown, State = #state{name = Name}) -> rabbit_shovel_status:remove(Name), ok; terminate(socket_closed_unexpectedly, State = #state{name = Name}) -> - ?LOG_ERROR("Shovel ~ts is stopping because of the socket closed unexpectedly", [human_readable_name(Name)]), + ?LOG_ERROR("Shovel ~ts is stopping because of the socket closed unexpectedly", + [human_readable_name(Name)]), rabbit_shovel_status:report(State#state.name, State#state.type, {terminated, "socket closed"}), close_connections(State), ok; terminate({'EXIT', heartbeat_timeout}, State = #state{name = Name}) -> - ?LOG_ERROR("Shovel ~ts is stopping because of a heartbeat timeout", [human_readable_name(Name)]), + ?LOG_ERROR("Shovel ~ts is stopping because of a heartbeat timeout", + [human_readable_name(Name)]), rabbit_shovel_status:report(State#state.name, State#state.type, {terminated, "heartbeat timeout"}), close_connections(State), ok; terminate({'EXIT', outbound_conn_died}, State = #state{name = Name}) -> - ?LOG_ERROR("Shovel ~ts is stopping because destination connection failed", [human_readable_name(Name)]), + ?LOG_ERROR("Shovel ~ts is stopping because destination connection failed", + [human_readable_name(Name)]), rabbit_shovel_status:report(State#state.name, State#state.type, {terminated, "destination connection failed"}), close_connections(State), ok; terminate({'EXIT', inbound_conn_died}, State = #state{name = Name}) -> - ?LOG_ERROR("Shovel ~ts is stopping because destination connection failed", [human_readable_name(Name)]), + ?LOG_ERROR("Shovel ~ts is stopping because destination connection failed", + [human_readable_name(Name)]), rabbit_shovel_status:report(State#state.name, State#state.type, {terminated, "source connection failed"}), close_connections(State),