@@ -505,10 +505,15 @@ execute_operation(State, {kill_wal}) ->
505505
506506 log (" ~s Killing WAL on member ~w ...~n " , [timestamp (), NodeName ]),
507507
508- Pid = erpc :call (NodeName , erlang , whereis , [ra_log_wal ]),
509- erpc :call (NodeName , erlang , exit , [Pid , kill ]),
510- State #{operations_count => OpCount + 1 ,
511- successful_ops => SuccessOps + 1 }
508+ case erpc :call (NodeName , erlang , whereis , [ra_log_wal ]) of
509+ Pid when is_pid (Pid ) ->
510+ erpc :call (NodeName , erlang , exit , [Pid , kill ]),
511+ State #{operations_count => OpCount + 1 ,
512+ successful_ops => SuccessOps + 1 };
513+ _ ->
514+ State
515+ end
516+
512517 end ;
513518
514519execute_operation (State , {kill_member }) ->
@@ -529,13 +534,17 @@ execute_operation(State, {kill_member}) ->
529534
530535 log (" ~s Killing member ~w ...~n " , [timestamp (), Member ]),
531536
532- Pid = erpc :call (NodeName , erlang , whereis , [? CLUSTER_NAME ]),
533- erpc :call (NodeName , erlang , exit , [Pid , kill ]),
534- % % give it a bit of time after a kill in case this member is chosen
535- % % for the next operation
536- timer :sleep (100 ),
537- State #{operations_count => OpCount + 1 ,
538- successful_ops => SuccessOps + 1 }
537+ case erpc :call (NodeName , erlang , whereis , [? CLUSTER_NAME ]) of
538+ Pid when is_pid (Pid ) ->
539+ erpc :call (NodeName , erlang , exit , [Pid , kill ]),
540+ % % give it a bit of time after a kill in case this member is chosen
541+ % % for the next operation
542+ timer :sleep (100 ),
543+ State #{operations_count => OpCount + 1 ,
544+ successful_ops => SuccessOps + 1 };
545+ _ ->
546+ State
547+ end
539548 end .
540549
541550-spec wait_for_applied_index_convergence ([ra :server_id ()], non_neg_integer ()) -> ok .
0 commit comments