fix(emqx_cover): wait for DOWN message before new spawn

This commit is contained in:
Zaiming (Stone) Shi 2022-12-19 09:23:05 +01:00
parent 22c27cb45f
commit 13b14aafa5
1 changed files with 7 additions and 1 deletions

View File

@ -100,7 +100,13 @@ abort() ->
_ = cover:stop(),
case whereis(?SRC) of
undefined -> ok;
Pid -> exit(Pid, kill)
Pid ->
Ref = monitor(process, Pid),
exit(Pid, kill),
receive
{'DOWN', Ref, process, Pid, _} ->
ok
end
end,
ok.