|
26 | 26 | status/0, |
27 | 27 | is_running/0, |
28 | 28 | is_clustered/0, |
29 | | - on_running_node/1, |
30 | | - is_process_alive/1, |
31 | | - is_registered_process_alive/1, |
32 | 29 | cluster_nodes/1, |
33 | 30 | node_type/0, |
34 | 31 | is_virgin_node/0, |
|
81 | 78 |
|
82 | 79 | -export([check_reset_gracefully/0]). |
83 | 80 |
|
84 | | --deprecated({on_running_node, 1, |
85 | | - "Use rabbit_process:on_running_node/1 instead"}). |
86 | | --deprecated({is_process_alive, 1, |
87 | | - "Use rabbit_process:is_process_alive/1 instead"}). |
88 | | --deprecated({is_registered_process_alive, 1, |
89 | | - "Use rabbit_process:is_registered_process_alive/1 instead"}). |
90 | | - |
91 | 81 | -ifdef(TEST). |
92 | 82 | -compile(export_all). |
93 | 83 | -endif. |
@@ -369,29 +359,6 @@ is_running() -> mnesia:system_info(is_running) =:= yes. |
369 | 359 | is_clustered() -> AllNodes = cluster_nodes(all), |
370 | 360 | AllNodes =/= [] andalso AllNodes =/= [node()]. |
371 | 361 |
|
372 | | --spec on_running_node(pid()) -> boolean(). |
373 | | - |
374 | | -on_running_node(Pid) -> lists:member(node(Pid), cluster_nodes(running)). |
375 | | - |
376 | | -%% This requires the process be in the same running cluster as us |
377 | | -%% (i.e. not partitioned or some random node). |
378 | | -%% |
379 | | -%% See also rabbit_misc:is_process_alive/1 which does not. |
380 | | - |
381 | | --spec is_process_alive(pid() | {atom(), node()}) -> boolean(). |
382 | | - |
383 | | -is_process_alive(Pid) when is_pid(Pid) -> |
384 | | - on_running_node(Pid) andalso |
385 | | - rpc:call(node(Pid), erlang, is_process_alive, [Pid]) =:= true; |
386 | | -is_process_alive({Name, Node}) -> |
387 | | - lists:member(Node, cluster_nodes(running)) andalso |
388 | | - rpc:call(Node, rabbit_mnesia, is_registered_process_alive, [Name]) =:= true. |
389 | | - |
390 | | --spec is_registered_process_alive(atom()) -> boolean(). |
391 | | - |
392 | | -is_registered_process_alive(Name) -> |
393 | | - is_pid(whereis(Name)). |
394 | | - |
395 | 362 | -spec cluster_nodes('all' | 'disc' | 'ram' | 'running') -> [node()]; |
396 | 363 | ('status') -> {[node()], [node()], [node()]}. |
397 | 364 |
|
|
0 commit comments