You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Why]
The `cover:call/1` internal checks if the cover server is running and
starts it if it's not:
Ref = erlang:monitor(process,?SERVER),
receive {'DOWN', Ref, _Type, _Object, noproc} ->
erlang:demonitor(Ref),
{ok,_} = start(),
...
However, there is no lock between the check and
the start. Therefore, any concurrent uses of this code may cause a
`badmatch` crash on `{ok,_} = start()` because it might have been
started in parallel and the function returns the `already_started`
error.
[How]
To work around the problem, we catch the `badmatch` and retry once after
a sleep of 100 ms. We don't try to catch any exception from that second
attempt.
0 commit comments