[erlang-questions] Erlang and Akka, The Sequel

Fred Hebert <>
Sat Apr 4 17:32:12 CEST 2015


On 04/04, José Valim wrote:
>> If the `await` function is wrapped in a `catch`, then the message won't
>be handled properly.
>
>We have actually discussed this extensively. We have decided to not handle
>those cases because similar errors happen if you wrap a gen_server:call/3
>in a catch. If you trigger the call timeout and catch it, the gen server is
>going to eventually reply which will sit in your inbox. We believe there is
>one httpc bug caused due to this (anti-)pattern.
>

The difference is that gen_server's call has it only on timeouts and 
these responses.  The Async task has it on timeouts *and* errors where 
you know you will receive the 'DOWN' message *and* the 'EXIT' signal if 
you are trapping exits because you use spawn_link.

So any exit where it happens and is catched will leak these messages in 
a surefire way -- not just timeouts. OTP calls don't have this because 
they only set monitors, not monitors + links.


More information about the erlang-questions mailing list