File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -441,18 +441,19 @@ become_leader0(QName, Name) ->
441
441
-spec all_replica_states () -> {node (), #{atom () => atom ()}}.
442
442
all_replica_states () ->
443
443
Rows0 = ets :tab2list (ra_state ),
444
- Rows = lists :map (fun
444
+ Rows = lists :filtermap (
445
+ fun
445
446
(T = {K , _ , _ }) ->
446
- case rabbit_process : is_registered_process_alive (K ) of
447
- true ->
448
- to_replica_state ( T ) ;
449
- false ->
450
- []
447
+ case whereis (K ) of
448
+ undefined ->
449
+ false ;
450
+ P when is_pid ( P ) ->
451
+ { true , to_replica_state ( T )}
451
452
end ;
452
453
(_T ) ->
453
- []
454
- end , Rows0 ),
455
- {node (), maps :from_list (lists : flatten ( Rows ) )}.
454
+ false
455
+ end , Rows0 ),
456
+ {node (), maps :from_list (Rows )}.
456
457
457
458
to_replica_state ({K , follower , promotable }) ->
458
459
{K , promotable };
You can’t perform that action at this time.
0 commit comments