Skip to content

Commit

Permalink
Merge pull request erlang#9124 from dumbbell/fix-race-in-cover-start
Browse files Browse the repository at this point in the history
cover: Fix a race condition in how the server is started as part of a call

OTP-19517
  • Loading branch information
bjorng authored Mar 3, 2025
2 parents 5e48ebb + 05e49fe commit 3ff68a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/tools/src/cover.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,10 @@ call(Request) ->
Ref = erlang:monitor(process,?SERVER),
receive {'DOWN', Ref, _Type, _Object, noproc} ->
erlang:demonitor(Ref),
{ok,_} = start(),
case start() of
{ok,_} -> ok;
{error,{already_started,_}} -> ok
end,
call(Request)
after 0 ->
?SERVER ! {self(),Request},
Expand Down

0 comments on commit 3ff68a3

Please sign in to comment.