fix DOWN messages from external sources issue
This commit is contained in:
parent
95a8e3c32d
commit
2240decb95
2 changed files with 10 additions and 2 deletions
|
@ -772,8 +772,8 @@ receivefrom(Pid) ->
|
||||||
receive
|
receive
|
||||||
{Pid, R} ->
|
{Pid, R} ->
|
||||||
R;
|
R;
|
||||||
{'DOWN', _, _, BadPid, Reason} when Reason =/= normal ->
|
{'DOWN', _, _, Pid, Reason} when Reason =/= normal ->
|
||||||
erlang:throw({BadPid, Reason});
|
erlang:throw({Pid, Reason});
|
||||||
{timerrang, _} ->
|
{timerrang, _} ->
|
||||||
erlang:throw({nil, timeout})
|
erlang:throw({nil, timeout})
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -74,3 +74,11 @@ ftmap_bad_test() ->
|
||||||
?assertMatch([{value, 1}, {error,{throw,test_exception}}, {value, 3},
|
?assertMatch([{value, 1}, {error,{throw,test_exception}}, {value, 3},
|
||||||
{value, 4}, {value, 5}] , Results).
|
{value, 4}, {value, 5}] , Results).
|
||||||
|
|
||||||
|
external_down_message_test() ->
|
||||||
|
erlang:spawn_monitor(fun() -> erlang:throw(fail) end),
|
||||||
|
Results = ec_plists:map(fun(_) ->
|
||||||
|
ok
|
||||||
|
end,
|
||||||
|
lists:seq(1, 5)),
|
||||||
|
?assertMatch([ok, ok, ok, ok, ok],
|
||||||
|
Results).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue