Switch to rabbit_misc:is_process_alive/1
This commit is contained in:
parent
7d6588a5d3
commit
2c5ee14b5b
|
|
@ -133,7 +133,7 @@ gc_process(Table) ->
|
||||||
end, none, Table).
|
end, none, Table).
|
||||||
|
|
||||||
gc_process(Pid, Table, Key) ->
|
gc_process(Pid, Table, Key) ->
|
||||||
case is_process_alive_in_cluster(Pid) of
|
case rabbit_misc:is_process_alive(Pid) of
|
||||||
true ->
|
true ->
|
||||||
none;
|
none;
|
||||||
false ->
|
false ->
|
||||||
|
|
@ -195,7 +195,7 @@ gc_process_and_entity(Table, GbSet) ->
|
||||||
end, none, Table).
|
end, none, Table).
|
||||||
|
|
||||||
gc_process_and_entity(Id, Pid, Table, Key, GbSet) ->
|
gc_process_and_entity(Id, Pid, Table, Key, GbSet) ->
|
||||||
case is_process_alive_in_cluster(Pid) orelse gb_sets:is_member(Id, GbSet) of
|
case rabbit_misc:is_process_alive(Pid) orelse gb_sets:is_member(Id, GbSet) of
|
||||||
true ->
|
true ->
|
||||||
none;
|
none;
|
||||||
false ->
|
false ->
|
||||||
|
|
@ -204,7 +204,7 @@ gc_process_and_entity(Id, Pid, Table, Key, GbSet) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
gc_object(Pid, Table, Object) ->
|
gc_object(Pid, Table, Object) ->
|
||||||
case is_process_alive_in_cluster(Pid) of
|
case rabbit_misc:is_process_alive(Pid) of
|
||||||
true ->
|
true ->
|
||||||
none;
|
none;
|
||||||
false ->
|
false ->
|
||||||
|
|
@ -235,18 +235,3 @@ gc_entities(Table, QueueGbSet, ExchangeGbSet) ->
|
||||||
gc_object(Q, Table, Object, QueueGbSet),
|
gc_object(Q, Table, Object, QueueGbSet),
|
||||||
gc_entity(X, Table, X, ExchangeGbSet)
|
gc_entity(X, Table, X, ExchangeGbSet)
|
||||||
end, none, Table).
|
end, none, Table).
|
||||||
|
|
||||||
is_process_alive_in_cluster(Pid) ->
|
|
||||||
Local = node(),
|
|
||||||
case node(Pid) of
|
|
||||||
Local ->
|
|
||||||
is_process_alive(Pid);
|
|
||||||
Remote ->
|
|
||||||
case rabbit_misc:rpc_call(Remote, erlang, is_process_alive, [Pid]) of
|
|
||||||
Bool when is_boolean(Bool) ->
|
|
||||||
Bool;
|
|
||||||
{badrpc, _} ->
|
|
||||||
%% If the node is unreachable, the process might be dead
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end.
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue