From 046e0b9bb269fd8f12b65d1271ceed3f2daa1d6c Mon Sep 17 00:00:00 2001 From: Alvaro Videla Date: Sat, 31 Oct 2015 12:43:43 +0100 Subject: moves emitting_map to rabbit_control_misc --- deps/rabbit_common/src/rabbit_control_misc.erl | 70 ++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 deps/rabbit_common/src/rabbit_control_misc.erl (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl new file mode 100644 index 0000000000..97c32cde06 --- /dev/null +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -0,0 +1,70 @@ +%% The contents of this file are subject to the Mozilla Public License +%% Version 1.1 (the "License"); you may not use this file except in +%% compliance with the License. You may obtain a copy of the License +%% at http://www.mozilla.org/MPL/ +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and +%% limitations under the License. +%% +%% The Original Code is RabbitMQ. +%% +%% The Initial Developer of the Original Code is GoPivotal, Inc. +%% Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved. +%% + +-module(rabbit_control_misc). + +-export([emitting_map/4, emitting_map/5, emitting_map_with_wrapper_fun/5, + emitting_map_with_wrapper_fun/6, wait_for_info_messages/5]). + +-ifdef(use_specs). + +-spec(emitting_map/4 :: (pid(), reference(), fun(), list()) -> 'ok'). +-spec(emitting_map/5 :: (pid(), reference(), fun(), list(), atom()) -> 'ok'). + +-endif. + +emitting_map(AggregatorPid, Ref, Fun, List) -> + emitting_map(AggregatorPid, Ref, Fun, List, finished). +emitting_map(AggregatorPid, Ref, Fun, List, continue) -> + [AggregatorPid ! {Ref, Fun(Item), continue} || Item <- List]; +emitting_map(AggregatorPid, Ref, Fun, List, finished) -> + [AggregatorPid ! {Ref, Fun(Item)} || Item <- List], + AggregatorPid ! {Ref, finished}, + ok. + +emitting_map_with_wrapper_fun(AggregatorPid, Ref, Fun, WrapperFun, List) -> + emitting_map_with_wrapper_fun(AggregatorPid, Ref, Fun, WrapperFun, List, + finished). +emitting_map_with_wrapper_fun(AggregatorPid, Ref, Fun, WrapperFun, List, + continue) -> + WrapperFun(fun(Item) -> AggregatorPid ! {Ref, Fun(Item), continue} end, + List); +emitting_map_with_wrapper_fun(AggregatorPid, Ref, Fun, WrapperFun, List, + finished) -> + WrapperFun(fun(Item) -> AggregatorPid ! {Ref, Fun(Item)} end, List), + AggregatorPid ! {Ref, finished}, + ok. + +wait_for_info_messages(Pid, Ref, ArgAtoms, DisplayFun, Timeout) -> + notify_if_timeout(Pid, Ref, Timeout), + wait_for_info_messages(Ref, ArgAtoms, DisplayFun). + +wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) when is_reference(Ref) -> + receive + {Ref, finished} -> ok; + {Ref, {timeout, T}} -> exit({error, {timeout, (T / 1000)}}); + {Ref, []} -> wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); + {Ref, Result} -> DisplayFun(Result, InfoItemKeys), + wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); + {Ref, Result, continue} -> + DisplayFun(Result, InfoItemKeys), + wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); + _ -> + wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) + end. + +notify_if_timeout(Pid, Ref, Timeout) -> + timer:send_after(Timeout, Pid, {Ref, {timeout, Timeout}}). -- cgit v1.2.1 From 01da35dfdecd011932111619abe32e098e5cb4ad Mon Sep 17 00:00:00 2001 From: Alvaro Videla Date: Sun, 8 Nov 2015 21:22:05 +0100 Subject: refactors emitting_map helper --- deps/rabbit_common/src/rabbit_control_misc.erl | 60 ++++++++++++++++---------- 1 file changed, 38 insertions(+), 22 deletions(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 97c32cde06..c888d55ec2 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -16,49 +16,65 @@ -module(rabbit_control_misc). --export([emitting_map/4, emitting_map/5, emitting_map_with_wrapper_fun/5, - emitting_map_with_wrapper_fun/6, wait_for_info_messages/5]). +-export([emitting_map/4, emitting_map/5, emitting_map_with_exit_handler/4, + emitting_map_with_exit_handler/5, wait_for_info_messages/5]). -ifdef(use_specs). -spec(emitting_map/4 :: (pid(), reference(), fun(), list()) -> 'ok'). -spec(emitting_map/5 :: (pid(), reference(), fun(), list(), atom()) -> 'ok'). +-spec(emitting_map_with_exit_handler/4 :: + (pid(), reference(), fun(), list()) -> 'ok'). +-spec(emitting_map_with_exit_handler/5 :: + (pid(), reference(), fun(), list(), atom()) -> 'ok'). -endif. emitting_map(AggregatorPid, Ref, Fun, List) -> - emitting_map(AggregatorPid, Ref, Fun, List, finished). -emitting_map(AggregatorPid, Ref, Fun, List, continue) -> - [AggregatorPid ! {Ref, Fun(Item), continue} || Item <- List]; -emitting_map(AggregatorPid, Ref, Fun, List, finished) -> - [AggregatorPid ! {Ref, Fun(Item)} || Item <- List], + emitting_map(AggregatorPid, Ref, Fun, List, continue), AggregatorPid ! {Ref, finished}, ok. -emitting_map_with_wrapper_fun(AggregatorPid, Ref, Fun, WrapperFun, List) -> - emitting_map_with_wrapper_fun(AggregatorPid, Ref, Fun, WrapperFun, List, - finished). -emitting_map_with_wrapper_fun(AggregatorPid, Ref, Fun, WrapperFun, List, - continue) -> - WrapperFun(fun(Item) -> AggregatorPid ! {Ref, Fun(Item), continue} end, - List); -emitting_map_with_wrapper_fun(AggregatorPid, Ref, Fun, WrapperFun, List, - finished) -> - WrapperFun(fun(Item) -> AggregatorPid ! {Ref, Fun(Item)} end, List), +emitting_map(AggregatorPid, Ref, Fun, List, continue) -> + emitting_map0(AggregatorPid, Ref, Fun, List, fun step/4). + +emitting_map_with_exit_handler(AggregatorPid, Ref, Fun, List) -> + emitting_map_with_exit_handler(AggregatorPid, Ref, Fun, List, continue), AggregatorPid ! {Ref, finished}, ok. +emitting_map_with_exit_handler(AggregatorPid, Ref, Fun, List, continue) -> + emitting_map0(AggregatorPid, Ref, Fun, List, fun step_with_exit_handler/4). + +emitting_map0(AggregatorPid, Ref, Fun, List, StepFun) -> + [StepFun(AggregatorPid, Ref, Fun, Item) || Item <- List]. + +step(AggregatorPid, Ref, Fun, Item) -> + AggregatorPid ! {Ref, Fun(Item), continue}. + +step_with_exit_handler(AggregatorPid, Ref, Fun, Item) -> + Noop = make_ref(), + case rabbit_misc:with_exit_handler( + fun () -> Noop end, + fun () -> Fun(Item) end) of + Noop -> + ok; + Res -> + AggregatorPid ! {Ref, Res, continue} + end. + wait_for_info_messages(Pid, Ref, ArgAtoms, DisplayFun, Timeout) -> notify_if_timeout(Pid, Ref, Timeout), wait_for_info_messages(Ref, ArgAtoms, DisplayFun). wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) when is_reference(Ref) -> receive - {Ref, finished} -> ok; - {Ref, {timeout, T}} -> exit({error, {timeout, (T / 1000)}}); - {Ref, []} -> wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); - {Ref, Result} -> DisplayFun(Result, InfoItemKeys), - wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); + {Ref, finished} -> + ok; + {Ref, {timeout, T}} -> + exit({error, {timeout, (T / 1000)}}); + {Ref, []} -> + wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); {Ref, Result, continue} -> DisplayFun(Result, InfoItemKeys), wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); -- cgit v1.2.1 From 02a8a143200bdf075990c96761fd8fe07c48b16c Mon Sep 17 00:00:00 2001 From: Alvaro Videla Date: Mon, 16 Nov 2015 12:59:06 +0100 Subject: report error back to user --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index c888d55ec2..6f5b3e8452 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -78,6 +78,8 @@ wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) when is_reference(Ref) -> {Ref, Result, continue} -> DisplayFun(Result, InfoItemKeys), wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); + {error, Error} -> + Error; _ -> wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) end. -- cgit v1.2.1 From e4bd036f4bbe1d19568724dadd989f3a3505bf2e Mon Sep 17 00:00:00 2001 From: Ayanda Dube Date: Thu, 19 Nov 2015 12:16:07 +0000 Subject: Moves print_cmd_result/2 from discarded rabbit_ctl_misc to rabbit_control_misc. References #428 --- deps/rabbit_common/src/rabbit_control_misc.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 6f5b3e8452..6cdae06138 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -17,7 +17,8 @@ -module(rabbit_control_misc). -export([emitting_map/4, emitting_map/5, emitting_map_with_exit_handler/4, - emitting_map_with_exit_handler/5, wait_for_info_messages/5]). + emitting_map_with_exit_handler/5, wait_for_info_messages/5, + print_cmd_result/2]). -ifdef(use_specs). @@ -27,6 +28,7 @@ (pid(), reference(), fun(), list()) -> 'ok'). -spec(emitting_map_with_exit_handler/5 :: (pid(), reference(), fun(), list(), atom()) -> 'ok'). +-spec(print_cmd_result/2 :: (atom(), term()) -> string()). -endif. @@ -86,3 +88,5 @@ wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) when is_reference(Ref) -> notify_if_timeout(Pid, Ref, Timeout) -> timer:send_after(Timeout, Pid, {Ref, {timeout, Timeout}}). + +print_cmd_result(authenticate_user, _Result) -> io:format("Success~n"). -- cgit v1.2.1 From 4e13b67e44c05834dcd3b087a9d59fdec6e02459 Mon Sep 17 00:00:00 2001 From: Alvaro Videla Date: Fri, 20 Nov 2015 16:46:59 +0100 Subject: fixes specs and warnings --- deps/rabbit_common/src/rabbit_control_misc.erl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 6cdae06138..050f7a1a85 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -28,7 +28,7 @@ (pid(), reference(), fun(), list()) -> 'ok'). -spec(emitting_map_with_exit_handler/5 :: (pid(), reference(), fun(), list(), atom()) -> 'ok'). --spec(print_cmd_result/2 :: (atom(), term()) -> string()). +-spec(print_cmd_result/2 :: (atom(), term()) -> 'ok'). -endif. @@ -38,7 +38,8 @@ emitting_map(AggregatorPid, Ref, Fun, List) -> ok. emitting_map(AggregatorPid, Ref, Fun, List, continue) -> - emitting_map0(AggregatorPid, Ref, Fun, List, fun step/4). + _ = emitting_map0(AggregatorPid, Ref, Fun, List, fun step/4), + ok. emitting_map_with_exit_handler(AggregatorPid, Ref, Fun, List) -> emitting_map_with_exit_handler(AggregatorPid, Ref, Fun, List, continue), @@ -46,13 +47,15 @@ emitting_map_with_exit_handler(AggregatorPid, Ref, Fun, List) -> ok. emitting_map_with_exit_handler(AggregatorPid, Ref, Fun, List, continue) -> - emitting_map0(AggregatorPid, Ref, Fun, List, fun step_with_exit_handler/4). + _ = emitting_map0(AggregatorPid, Ref, Fun, List, fun step_with_exit_handler/4), + ok. emitting_map0(AggregatorPid, Ref, Fun, List, StepFun) -> [StepFun(AggregatorPid, Ref, Fun, Item) || Item <- List]. step(AggregatorPid, Ref, Fun, Item) -> - AggregatorPid ! {Ref, Fun(Item), continue}. + AggregatorPid ! {Ref, Fun(Item), continue}, + ok. step_with_exit_handler(AggregatorPid, Ref, Fun, Item) -> Noop = make_ref(), @@ -62,11 +65,12 @@ step_with_exit_handler(AggregatorPid, Ref, Fun, Item) -> Noop -> ok; Res -> - AggregatorPid ! {Ref, Res, continue} + AggregatorPid ! {Ref, Res, continue}, + ok end. wait_for_info_messages(Pid, Ref, ArgAtoms, DisplayFun, Timeout) -> - notify_if_timeout(Pid, Ref, Timeout), + _ = notify_if_timeout(Pid, Ref, Timeout), wait_for_info_messages(Ref, ArgAtoms, DisplayFun). wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) when is_reference(Ref) -> -- cgit v1.2.1 From fa11de3068ea0107fd46e63ff3e073ee58c72642 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Fri, 1 Jan 2016 12:59:16 +0300 Subject: Update (c) info --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 050f7a1a85..2e274e858b 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -11,7 +11,7 @@ %% The Original Code is RabbitMQ. %% %% The Initial Developer of the Original Code is GoPivotal, Inc. -%% Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved. +%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved. %% -module(rabbit_control_misc). -- cgit v1.2.1 From 1f35ff53e127269c4ba2985567b4f47ea99e7ece Mon Sep 17 00:00:00 2001 From: Alexey Lebedeff Date: Wed, 9 Mar 2016 14:55:02 +0300 Subject: Avoid RPC roundtrips while listing items - Emit info about particular items in parallel on every node, with results delivered directly to a `rabbitmqctl` instance. - `rabbit_control_misc:wait_for_info_messages/5` can wait for results of more than one emitting map. - Stop passing arround InfoItemKeys in `rabbit_control_misc:wait_for_info_messages/5`, the same information could be directly encoded in DisplayFun closure. - Add `emit` to function names, to avoid confusion with regular ones which return result directly. Part of https://github.com/rabbitmq/rabbitmq-server/pull/683 --- deps/rabbit_common/src/rabbit_control_misc.erl | 127 +++++++++++++++++++++---- 1 file changed, 109 insertions(+), 18 deletions(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 2e274e858b..e479757e21 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -17,7 +17,8 @@ -module(rabbit_control_misc). -export([emitting_map/4, emitting_map/5, emitting_map_with_exit_handler/4, - emitting_map_with_exit_handler/5, wait_for_info_messages/5, + emitting_map_with_exit_handler/5, wait_for_info_messages/6, + spawn_emitter_caller/7, await_emitters_termination/1, print_cmd_result/2]). -ifdef(use_specs). @@ -27,7 +28,16 @@ -spec(emitting_map_with_exit_handler/4 :: (pid(), reference(), fun(), list()) -> 'ok'). -spec(emitting_map_with_exit_handler/5 :: - (pid(), reference(), fun(), list(), atom()) -> 'ok'). + (pid(), reference(), fun(), list(), 'continue') -> 'ok'). + +-type fold_fun() :: fun((Item, AccIn) -> AccOut) when + Item :: term(), AccIn :: term(), AccOut :: term(). + +-spec(wait_for_info_messages/6 :: (pid(), reference(), fold_fun(), InitialAcc, timeout(), non_neg_integer()) -> OK | Err) when + InitialAcc :: term(), Acc :: term(), OK :: {ok, Acc}, Err :: {error, term()}. +-spec(spawn_emitter_caller/7 :: (node(), module(), atom(), [term()], reference(), pid(), timeout()) -> 'ok'). +-spec(await_emitters_termination/1 :: ([pid()]) -> 'ok'). + -spec(print_cmd_result/2 :: (atom(), term()) -> 'ok'). -endif. @@ -69,27 +79,108 @@ step_with_exit_handler(AggregatorPid, Ref, Fun, Item) -> ok end. -wait_for_info_messages(Pid, Ref, ArgAtoms, DisplayFun, Timeout) -> - _ = notify_if_timeout(Pid, Ref, Timeout), - wait_for_info_messages(Ref, ArgAtoms, DisplayFun). +%% Invokes RPC for async info collection in separate (but linked to +%% the caller) process. Separate process waits for RPC to finish and +%% in case of errors sends them in wait_for_info_messages/5-compatible +%% form to aggregator process. Calling process is then expected to +%% do blocking call of wait_for_info_messages/5. +%% +%% Remote function MUST use calls to emitting_map/4 (and other +%% emitting_map's) to properly deliver requested information to an +%% aggregator process. +%% +%% If for performance reasons several parallel emitting_map's need to +%% be run, remote function MUST NOT return until all this +%% emitting_map's are done. And during all this time remote RPC +%% process MUST be linked to emitting +%% processes. await_emitters_termination/1 helper can be used as a +%% last statement of remote function to ensure this behaviour. +spawn_emitter_caller(Node, Mod, Fun, Args, Ref, Pid, Timeout) -> + spawn_monitor( + fun () -> + case rpc_call_emitter(Node, Mod, Fun, Args, Ref, Pid, Timeout) of + {error, _} = Error -> + Pid ! {Ref, error, Error}; + {bad_argument, _} = Error -> + Pid ! {Ref, error, Error}; + {badrpc, _} = Error -> + Pid ! {Ref, error, Error}; + _ -> + ok + end + end), + ok. + +rpc_call_emitter(Node, Mod, Fun, Args, Ref, Pid, Timeout) -> + rabbit_misc:rpc_call(Node, Mod, Fun, Args++[Ref, Pid], Timeout). + +%% Agregator process expects correct numbers of explicits ACKs about +%% finished emission process. While everything is linked, we still +%% need somehow to wait for termination of all emitters before +%% returning from RPC call - otherwise links will be just broken with +%% reason 'normal' and we can miss some errors, and subsequentially +%% hang. +await_emitters_termination(Pids) -> + Monitors = [erlang:monitor(process, Pid) || Pid <- Pids], + collect_monitors(Monitors). + +collect_monitors([]) -> + ok; +collect_monitors([Monitor|Rest]) -> + receive + {'DOWN', Monitor, _Pid, normal} -> + collect_monitors(Rest); + {'DOWN', Monitor, _Pid, noproc} -> + %% There is a link and a monitor to a process. Matching + %% this clause means that process has gracefully + %% terminated even before we've started monitoring. + collect_monitors(Rest); + {'DOWN', _, Pid, Reason} -> + exit({emitter_exit, Pid, Reason}) + end. -wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) when is_reference(Ref) -> +%% Wait for result of one or more calls to emitting_map-family +%% functions. +%% +%% Number of expected acknowledgments is specified by ChunkCount +%% argument. Most common usage will be with ChunkCount equals to +%% number of live nodes, but it's not mandatory - thus more generic +%% name of 'ChunkCount' was chosen. +wait_for_info_messages(Pid, Ref, Fun, Acc0, Timeout, ChunkCount) -> + notify_if_timeout(Pid, Ref, Timeout), + wait_for_info_messages(Ref, Fun, Acc0, ChunkCount). + +wait_for_info_messages(Ref, Fun, Acc0, ChunksLeft) -> receive - {Ref, finished} -> - ok; - {Ref, {timeout, T}} -> + {Ref, finished} when ChunksLeft =:= 1 -> + {ok, Acc0}; + {Ref, finished} -> + wait_for_info_messages(Ref, Fun, Acc0, ChunksLeft - 1); + {Ref, {timeout, T}} -> exit({error, {timeout, (T / 1000)}}); - {Ref, []} -> - wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); - {Ref, Result, continue} -> - DisplayFun(Result, InfoItemKeys), - wait_for_info_messages(Ref, InfoItemKeys, DisplayFun); - {error, Error} -> - Error; - _ -> - wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) + {Ref, []} -> + wait_for_info_messages(Ref, Fun, Acc0, ChunksLeft); + {Ref, Result, continue} -> + wait_for_info_messages(Ref, Fun, Fun(Result, Acc0), ChunksLeft); + {Ref, error, Error} -> + {error, simplify_emission_error(Error)}; + {'DOWN', _MRef, process, _Pid, normal} -> + wait_for_info_messages(Ref, Fun, Acc0, ChunksLeft); + {'DOWN', _MRef, process, _Pid, Reason} -> + {error, simplify_emission_error(Reason)}; + _Msg -> + wait_for_info_messages(Ref, Fun, Acc0, ChunksLeft) end. +simplify_emission_error({badrpc, {'EXIT', {{nocatch, EmissionError}, _Stacktrace}}}) -> + EmissionError; +simplify_emission_error({{nocatch, EmissionError}, _Stacktrace}) -> + EmissionError; +simplify_emission_error(Anything) -> + {error, Anything}. + +notify_if_timeout(_, _, infinity) -> + ok; notify_if_timeout(Pid, Ref, Timeout) -> timer:send_after(Timeout, Pid, {Ref, {timeout, Timeout}}). -- cgit v1.2.1 From fa00b59b6cda8e705ae99a639bd22f045b1c401e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Mon, 30 May 2016 18:27:11 +0200 Subject: rabbit_control_misc: Do not put {error, _} inside another {error, _} tuple ... when querying results in parallel. This fixes all `list_*` commands where an error was reported as eg.: {error, {error, {no_such_user,<<"user_management">>}}} --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index e479757e21..1e419ded8a 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -176,6 +176,8 @@ simplify_emission_error({badrpc, {'EXIT', {{nocatch, EmissionError}, _Stacktrace EmissionError; simplify_emission_error({{nocatch, EmissionError}, _Stacktrace}) -> EmissionError; +simplify_emission_error({error, _} = Error) -> + Error; simplify_emission_error(Anything) -> {error, Anything}. -- cgit v1.2.1 From 9d0f456347b2b8231464fe8c17aa20fb99fcc5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Tue, 31 May 2016 10:27:35 +0200 Subject: rabbit_control_misc: Do not put {bad_argument, _} inside a {error, _} tuple This restores the same behavior as RabbitMQ 3.6.x. --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 1e419ded8a..919eaf92a2 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -178,6 +178,8 @@ simplify_emission_error({{nocatch, EmissionError}, _Stacktrace}) -> EmissionError; simplify_emission_error({error, _} = Error) -> Error; +simplify_emission_error({bad_argument, _} = Error) -> + Error; simplify_emission_error(Anything) -> {error, Anything}. -- cgit v1.2.1 From 58c209a6d6aa12e0e319d74971a16735273c67a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Mon, 27 Jun 2016 15:09:17 +0200 Subject: Use the new -spec format The old format is removed in Erlang 19.0, leading to build errors. Also, get rid of the `use_specs` macro and thus always define -spec() & friends. While here, unnify the style of -type and -spec. References rabbitmq/rabbitmq-server#860. [#118562897] [#122335241] --- deps/rabbit_common/src/rabbit_control_misc.erl | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 2e274e858b..0d2de1f1c4 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -20,17 +20,13 @@ emitting_map_with_exit_handler/5, wait_for_info_messages/5, print_cmd_result/2]). --ifdef(use_specs). - --spec(emitting_map/4 :: (pid(), reference(), fun(), list()) -> 'ok'). --spec(emitting_map/5 :: (pid(), reference(), fun(), list(), atom()) -> 'ok'). --spec(emitting_map_with_exit_handler/4 :: - (pid(), reference(), fun(), list()) -> 'ok'). --spec(emitting_map_with_exit_handler/5 :: - (pid(), reference(), fun(), list(), atom()) -> 'ok'). --spec(print_cmd_result/2 :: (atom(), term()) -> 'ok'). - --endif. +-spec emitting_map(pid(), reference(), fun(), list()) -> 'ok'. +-spec emitting_map(pid(), reference(), fun(), list(), atom()) -> 'ok'. +-spec emitting_map_with_exit_handler + (pid(), reference(), fun(), list()) -> 'ok'. +-spec emitting_map_with_exit_handler + (pid(), reference(), fun(), list(), atom()) -> 'ok'. +-spec print_cmd_result(atom(), term()) -> 'ok'. emitting_map(AggregatorPid, Ref, Fun, List) -> emitting_map(AggregatorPid, Ref, Fun, List, continue), -- cgit v1.2.1 From 04600ec7d44f4d19c31cefd76c0008f47991319d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Wed, 29 Jun 2016 11:25:37 +0200 Subject: Fix a few errors in -spec which crept in during the merge of stable References rabbitmq/rabbitmq-server#860. [#122335241] --- deps/rabbit_common/src/rabbit_control_misc.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 3153d659a8..bafe563022 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -28,8 +28,7 @@ -spec emitting_map_with_exit_handler (pid(), reference(), fun(), list(), 'continue') -> 'ok'. --type fold_fun() :: fun((Item, AccIn) -> AccOut) when - Item :: term(), AccIn :: term(), AccOut :: term(). +-type fold_fun() :: fun((Item :: term(), AccIn :: term()) -> AccOut :: term()). -spec wait_for_info_messages(pid(), reference(), fold_fun(), InitialAcc, timeout(), non_neg_integer()) -> OK | Err when InitialAcc :: term(), Acc :: term(), OK :: {ok, Acc}, Err :: {error, term()}. -- cgit v1.2.1 From c3cd7d3f45c8db8457ce649dbb0d83a722b645fb Mon Sep 17 00:00:00 2001 From: Alexey Lebedeff Date: Thu, 30 Jun 2016 19:31:59 +0300 Subject: Don't spew stacktrace on join when already member Example of stacktrace - https://github.com/rabbitmq/rabbitmq-server/issues/709 --- deps/rabbit_common/src/rabbit_control_misc.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 0d2de1f1c4..23f5dc108b 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -89,4 +89,5 @@ wait_for_info_messages(Ref, InfoItemKeys, DisplayFun) when is_reference(Ref) -> notify_if_timeout(Pid, Ref, Timeout) -> timer:send_after(Timeout, Pid, {Ref, {timeout, Timeout}}). -print_cmd_result(authenticate_user, _Result) -> io:format("Success~n"). +print_cmd_result(authenticate_user, _Result) -> io:format("Success~n"); +print_cmd_result(join_cluster, already_member) -> io:format("The node is a member of this cluster~n"). -- cgit v1.2.1 From 51fe19beeaf1bd6dab872df505c5ff1223d6ae0f Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Wed, 13 Jul 2016 03:44:14 +0300 Subject: Wording --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 23f5dc108b..2e1f6cc81b 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -90,4 +90,4 @@ notify_if_timeout(Pid, Ref, Timeout) -> timer:send_after(Timeout, Pid, {Ref, {timeout, Timeout}}). print_cmd_result(authenticate_user, _Result) -> io:format("Success~n"); -print_cmd_result(join_cluster, already_member) -> io:format("The node is a member of this cluster~n"). +print_cmd_result(join_cluster, already_member) -> io:format("The node is already a member of this cluster~n"). -- cgit v1.2.1 From ccf24685bf24956cf6a15c3cf0e9e75080e594c2 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Apr 2017 21:46:50 +0300 Subject: (c) year --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 2e1f6cc81b..ccce1b0d7b 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -11,7 +11,7 @@ %% The Original Code is RabbitMQ. %% %% The Initial Developer of the Original Code is GoPivotal, Inc. -%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved. +%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved. %% -module(rabbit_control_misc). -- cgit v1.2.1 From 6ef7287822454f21c2f57bf04ea7a017c1db57bb Mon Sep 17 00:00:00 2001 From: Daniil Fedotov Date: Thu, 1 Jun 2017 13:36:06 +0100 Subject: Fix monitor message patterns for collect_monitors. --- deps/rabbit_common/src/rabbit_control_misc.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index ed5441107b..28a17a2791 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -123,14 +123,14 @@ collect_monitors([]) -> ok; collect_monitors([Monitor|Rest]) -> receive - {'DOWN', Monitor, _Pid, normal} -> + {'DOWN', Monitor, process, _Pid, normal} -> collect_monitors(Rest); - {'DOWN', Monitor, _Pid, noproc} -> + {'DOWN', Monitor, process, _Pid, noproc} -> %% There is a link and a monitor to a process. Matching %% this clause means that process has gracefully %% terminated even before we've started monitoring. collect_monitors(Rest); - {'DOWN', _, Pid, Reason} -> + {'DOWN', _, process, Pid, Reason} -> exit({emitter_exit, Pid, Reason}) end. -- cgit v1.2.1 From 7eb3b7f02276787a8d80835a9cf147fde8cc40c5 Mon Sep 17 00:00:00 2001 From: Daniil Fedotov Date: Wed, 7 Jun 2017 12:18:58 +0100 Subject: Do not fail info emitter collector on normal exit. --- deps/rabbit_common/src/rabbit_control_misc.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 28a17a2791..bd4181b376 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -130,7 +130,8 @@ collect_monitors([Monitor|Rest]) -> %% this clause means that process has gracefully %% terminated even before we've started monitoring. collect_monitors(Rest); - {'DOWN', _, process, Pid, Reason} -> + {'DOWN', _, process, Pid, Reason} when Reason =/= normal, + Reason =/= noproc -> exit({emitter_exit, Pid, Reason}) end. -- cgit v1.2.1 From a323a8a94c8c6e7d5a56d986878969e51eb36f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Thu, 1 Feb 2018 17:13:02 +0100 Subject: Explicitly ignore return values we don't care about These warnings were reported by Dialyzer. [#153850881] --- deps/rabbit_common/src/rabbit_control_misc.erl | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index bd4181b376..22a8a0b16d 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -91,19 +91,19 @@ step_with_exit_handler(AggregatorPid, Ref, Fun, Item) -> %% processes. await_emitters_termination/1 helper can be used as a %% last statement of remote function to ensure this behaviour. spawn_emitter_caller(Node, Mod, Fun, Args, Ref, Pid, Timeout) -> - spawn_monitor( - fun () -> - case rpc_call_emitter(Node, Mod, Fun, Args, Ref, Pid, Timeout) of - {error, _} = Error -> - Pid ! {Ref, error, Error}; - {bad_argument, _} = Error -> - Pid ! {Ref, error, Error}; - {badrpc, _} = Error -> - Pid ! {Ref, error, Error}; - _ -> - ok - end - end), + _ = spawn_monitor( + fun () -> + case rpc_call_emitter(Node, Mod, Fun, Args, Ref, Pid, Timeout) of + {error, _} = Error -> + Pid ! {Ref, error, Error}; + {bad_argument, _} = Error -> + Pid ! {Ref, error, Error}; + {badrpc, _} = Error -> + Pid ! {Ref, error, Error}; + _ -> + ok + end + end), ok. rpc_call_emitter(Node, Mod, Fun, Args, Ref, Pid, Timeout) -> @@ -143,7 +143,7 @@ collect_monitors([Monitor|Rest]) -> %% number of live nodes, but it's not mandatory - thus more generic %% name of 'ChunkCount' was chosen. wait_for_info_messages(Pid, Ref, Fun, Acc0, Timeout, ChunkCount) -> - notify_if_timeout(Pid, Ref, Timeout), + _ = notify_if_timeout(Pid, Ref, Timeout), wait_for_info_messages(Ref, Fun, Acc0, ChunkCount). wait_for_info_messages(Ref, Fun, Acc0, ChunksLeft) -> -- cgit v1.2.1 From fe1f2a3250274aca915b96144360dbf95ba50da6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 12 Feb 2019 00:01:34 -0500 Subject: spelling: aggregator --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 22a8a0b16d..23846e53ac 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -109,7 +109,7 @@ spawn_emitter_caller(Node, Mod, Fun, Args, Ref, Pid, Timeout) -> rpc_call_emitter(Node, Mod, Fun, Args, Ref, Pid, Timeout) -> rabbit_misc:rpc_call(Node, Mod, Fun, Args++[Ref, Pid], Timeout). -%% Agregator process expects correct numbers of explicits ACKs about +%% Aggregator process expects correct numbers of explicits ACKs about %% finished emission process. While everything is linked, we still %% need somehow to wait for termination of all emitters before %% returning from RPC call - otherwise links will be just broken with -- cgit v1.2.1 From 38749707905a9cc5e0f335fd1979ac534fa2c5a4 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 12 Feb 2019 00:21:30 -0500 Subject: spelling: subsequently --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 23846e53ac..e3f2301832 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -113,7 +113,7 @@ rpc_call_emitter(Node, Mod, Fun, Args, Ref, Pid, Timeout) -> %% finished emission process. While everything is linked, we still %% need somehow to wait for termination of all emitters before %% returning from RPC call - otherwise links will be just broken with -%% reason 'normal' and we can miss some errors, and subsequentially +%% reason 'normal' and we can miss some errors, and subsequently %% hang. await_emitters_termination(Pids) -> Monitors = [erlang:monitor(process, Pid) || Pid <- Pids], -- cgit v1.2.1 From 882876297bd360c34745d64eff198cb486a07e04 Mon Sep 17 00:00:00 2001 From: Spring Operator Date: Wed, 20 Mar 2019 03:13:48 -0500 Subject: URL Cleanup This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener). # HTTP URLs that Could Not Be Fixed These URLs were unable to be fixed. Please review them to see if they can be manually resolved. * http://blog.listincomprehension.com/search/label/procket (200) with 1 occurrences could not be migrated: ([https](https://blog.listincomprehension.com/search/label/procket) result ClosedChannelException). * http://dozzie.jarowit.net/trac/wiki/TOML (200) with 1 occurrences could not be migrated: ([https](https://dozzie.jarowit.net/trac/wiki/TOML) result SSLHandshakeException). * http://dozzie.jarowit.net/trac/wiki/subproc (200) with 1 occurrences could not be migrated: ([https](https://dozzie.jarowit.net/trac/wiki/subproc) result SSLHandshakeException). * http://e2project.org (200) with 1 occurrences could not be migrated: ([https](https://e2project.org) result AnnotatedConnectException). * http://erlang.org/doc/apps/erts/erl_ext_dist.html (200) with 1 occurrences could not be migrated: ([https](https://erlang.org/doc/apps/erts/erl_ext_dist.html) result ConnectTimeoutException). * http://erlang.org/doc/man/erlang.html (200) with 1 occurrences could not be migrated: ([https](https://erlang.org/doc/man/erlang.html) result ConnectTimeoutException). * http://nitrogenproject.com/ (200) with 2 occurrences could not be migrated: ([https](https://nitrogenproject.com/) result ConnectTimeoutException). * http://proper.softlab.ntua.gr (200) with 1 occurrences could not be migrated: ([https](https://proper.softlab.ntua.gr) result SSLHandshakeException). * http://yaws.hyber.org (200) with 1 occurrences could not be migrated: ([https](https://yaws.hyber.org) result AnnotatedConnectException). * http://choven.ca (503) with 1 occurrences could not be migrated: ([https](https://choven.ca) result ConnectTimeoutException). # Fixed URLs ## Fixed But Review Recommended These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended. * http://fixprotocol.org/ (301) with 1 occurrences migrated to: https://fixtrading.org ([https](https://fixprotocol.org/) result SSLHandshakeException). * http://erldb.org (UnknownHostException) with 1 occurrences migrated to: https://erldb.org ([https](https://erldb.org) result UnknownHostException). * http://host (UnknownHostException) with 1 occurrences migrated to: https://host ([https](https://host) result UnknownHostException). * http://host:port/foo (UnknownHostException) with 2 occurrences migrated to: https://host:port/foo ([https](https://host:port/foo) result UnknownHostException). * http://www.cs.indiana.edu/~burger/fp/index.html (301) with 1 occurrences migrated to: https://cs.indiana.edu/~burger/fp/index.html ([https](https://www.cs.indiana.edu/~burger/fp/index.html) result 404). ## Fixed Success These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended. * http://cloudi.org/ with 27 occurrences migrated to: https://cloudi.org/ ([https](https://cloudi.org/) result 200). * http://en.wikipedia.org/wiki/X86-64 with 1 occurrences migrated to: https://en.wikipedia.org/wiki/X86-64 ([https](https://en.wikipedia.org/wiki/X86-64) result 200). * http://erlware.org/ with 1 occurrences migrated to: https://erlware.org/ ([https](https://erlware.org/) result 200). * http://inaka.github.io/cowboy-trails/ with 1 occurrences migrated to: https://inaka.github.io/cowboy-trails/ ([https](https://inaka.github.io/cowboy-trails/) result 200). * http://lukego.livejournal.com/6753.html with 1 occurrences migrated to: https://lukego.livejournal.com/6753.html ([https](https://lukego.livejournal.com/6753.html) result 200). * http://ninenines.eu with 6 occurrences migrated to: https://ninenines.eu ([https](https://ninenines.eu) result 200). * http://semver.org/ with 1 occurrences migrated to: https://semver.org/ ([https](https://semver.org/) result 200). * http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html with 1 occurrences migrated to: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html ([https](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) result 200). * http://www.actordb.com/ with 2 occurrences migrated to: https://www.actordb.com/ ([https](https://www.actordb.com/) result 200). * http://www.cs.kent.ac.uk/projects/wrangler/Home.html with 1 occurrences migrated to: https://www.cs.kent.ac.uk/projects/wrangler/Home.html ([https](https://www.cs.kent.ac.uk/projects/wrangler/Home.html) result 200). * http://www.erlang.org/ with 2 occurrences migrated to: https://www.erlang.org/ ([https](https://www.erlang.org/) result 200). * http://www.mail-archive.com/asn1@asn1.org/msg00460.html with 1 occurrences migrated to: https://www.mail-archive.com/asn1@asn1.org/msg00460.html ([https](https://www.mail-archive.com/asn1@asn1.org/msg00460.html) result 200). * http://www.rabbitmq.com/ with 2 occurrences migrated to: https://www.rabbitmq.com/ ([https](https://www.rabbitmq.com/) result 200). * http://www.rabbitmq.com/amqp-0-9-1-errata.html with 1 occurrences migrated to: https://www.rabbitmq.com/amqp-0-9-1-errata.html ([https](https://www.rabbitmq.com/amqp-0-9-1-errata.html) result 200). * http://www.rabbitmq.com/memory.html with 1 occurrences migrated to: https://www.rabbitmq.com/memory.html ([https](https://www.rabbitmq.com/memory.html) result 200). * http://www.rebar3.org with 1 occurrences migrated to: https://www.rebar3.org ([https](https://www.rebar3.org) result 200). * http://code.google.com/p/clink/issues/detail?id=141 with 1 occurrences migrated to: https://code.google.com/p/clink/issues/detail?id=141 ([https](https://code.google.com/p/clink/issues/detail?id=141) result 301). * http://contributor-covenant.org with 1 occurrences migrated to: https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301). * http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to: https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301). * http://inaka.github.com/apns4erl with 1 occurrences migrated to: https://inaka.github.com/apns4erl ([https](https://inaka.github.com/apns4erl) result 301). * http://inaka.github.com/edis/ with 1 occurrences migrated to: https://inaka.github.com/edis/ ([https](https://inaka.github.com/edis/) result 301). * http://lasp-lang.org/ with 1 occurrences migrated to: https://lasp-lang.org/ ([https](https://lasp-lang.org/) result 301). * http://msdn.microsoft.com/en-us/library/aa366778 with 1 occurrences migrated to: https://msdn.microsoft.com/en-us/library/aa366778 ([https](https://msdn.microsoft.com/en-us/library/aa366778) result 301). * http://msdn.microsoft.com/en-us/library/bb540814 with 1 occurrences migrated to: https://msdn.microsoft.com/en-us/library/bb540814 ([https](https://msdn.microsoft.com/en-us/library/bb540814) result 301). * http://rabbitmq.com/documentation.html with 1 occurrences migrated to: https://rabbitmq.com/documentation.html ([https](https://rabbitmq.com/documentation.html) result 301). * http://saleyn.github.com/erlexec with 1 occurrences migrated to: https://saleyn.github.com/erlexec ([https](https://saleyn.github.com/erlexec) result 301). * http://www.erlang.org/doc/system_principles/versions.html with 1 occurrences migrated to: https://www.erlang.org/doc/system_principles/versions.html ([https](https://www.erlang.org/doc/system_principles/versions.html) result 301). * http://www.mozilla.org/MPL/ with 66 occurrences migrated to: https://www.mozilla.org/MPL/ ([https](https://www.mozilla.org/MPL/) result 301). * http://zhongwencool.github.io/observer_cli with 1 occurrences migrated to: https://zhongwencool.github.io/observer_cli ([https](https://zhongwencool.github.io/observer_cli) result 301). --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index e3f2301832..8a405961a6 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -1,7 +1,7 @@ %% The contents of this file are subject to the Mozilla Public License %% Version 1.1 (the "License"); you may not use this file except in %% compliance with the License. You may obtain a copy of the License -%% at http://www.mozilla.org/MPL/ +%% at https://www.mozilla.org/MPL/ %% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -- cgit v1.2.1 From b580595ea4fcee2a6c93fd9625bf4c6b49dae46b Mon Sep 17 00:00:00 2001 From: Diana Corbacho Date: Fri, 16 Aug 2019 15:00:50 +0100 Subject: Replace timer:send_after/3 by erlang:send_after/3 [#167926549] --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 8a405961a6..4de49ae2bc 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -182,7 +182,7 @@ simplify_emission_error(Anything) -> notify_if_timeout(_, _, infinity) -> ok; notify_if_timeout(Pid, Ref, Timeout) -> - timer:send_after(Timeout, Pid, {Ref, {timeout, Timeout}}). + erlang:send_after(Timeout, Pid, {Ref, {timeout, Timeout}}). print_cmd_result(authenticate_user, _Result) -> io:format("Success~n"); print_cmd_result(join_cluster, already_member) -> io:format("The node is already a member of this cluster~n"). -- cgit v1.2.1 From 818362766d9c483090802b9780cf173378e7d867 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sat, 28 Dec 2019 19:35:38 +0300 Subject: (c) bump (cherry picked from commit 013ba83abcce06c52c12e2a41e728c1e2399be60) --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 4de49ae2bc..7e071a413c 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -11,7 +11,7 @@ %% The Original Code is RabbitMQ. %% %% The Initial Developer of the Original Code is GoPivotal, Inc. -%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved. +%% Copyright (c) 2007-2020 Pivotal Software, Inc. All rights reserved. %% -module(rabbit_control_misc). -- cgit v1.2.1 From fa4b552a9bc62a65cc5ca9c519e86556c5143503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Tue, 10 Mar 2020 15:26:49 +0100 Subject: Update copyright (year 2020) --- deps/rabbit_common/src/rabbit_control_misc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 7e071a413c..087b73057e 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -11,7 +11,7 @@ %% The Original Code is RabbitMQ. %% %% The Initial Developer of the Original Code is GoPivotal, Inc. -%% Copyright (c) 2007-2020 Pivotal Software, Inc. All rights reserved. +%% Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. %% -module(rabbit_control_misc). -- cgit v1.2.1 From 368586ec1b52078537e198bd68d5420852b513a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Tue, 7 Jul 2020 17:56:14 +0200 Subject: Switch to Mozilla Public License 2.0 (MPL 2.0) --- deps/rabbit_common/src/rabbit_control_misc.erl | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'deps/rabbit_common/src/rabbit_control_misc.erl') diff --git a/deps/rabbit_common/src/rabbit_control_misc.erl b/deps/rabbit_common/src/rabbit_control_misc.erl index 087b73057e..0fff88a2cd 100644 --- a/deps/rabbit_common/src/rabbit_control_misc.erl +++ b/deps/rabbit_common/src/rabbit_control_misc.erl @@ -1,16 +1,7 @@ -%% The contents of this file are subject to the Mozilla Public License -%% Version 1.1 (the "License"); you may not use this file except in -%% compliance with the License. You may obtain a copy of the License -%% at https://www.mozilla.org/MPL/ +%% This Source Code Form is subject to the terms of the Mozilla Public +%% License, v. 2.0. If a copy of the MPL was not distributed with this +%% file, You can obtain one at https://mozilla.org/MPL/2.0/. %% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and -%% limitations under the License. -%% -%% The Original Code is RabbitMQ. -%% -%% The Initial Developer of the Original Code is GoPivotal, Inc. %% Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. %% -- cgit v1.2.1