Hacker News new | ask | show | jobs
by pramodliv1 3739 days ago
Loved the article! I'm not familiar with Erlang, but I was able to follow along and finally understood why OTP is usually distributed with Erlang.

If an Erlang process crashes when processing a message, and it is restarted, is the message replayed automatically by the runtime, or provide some kind of mechanism to recover the message as well?

1 comments

Erlang messaging's contract is 0-or-1 delivery. Once a process has received a message, it is in the recipients mailbox and no longer the runtime's problem. Resulting failures can theoretically cascade across a couple of processes tightly bound to that message's result, but handling that is Erlang's bread-and-butter, so generally, a couple of processes will drop dead, then be restarted. Some request will get lost but the system will keep going.

You can also do things like send a message across a node boundary to a node no longer connected, which looks a lot like sending a message to a process that crashes it. In the general case, you don't get an "error" message when that happens or anything, you just get timeouts as if the remote node received it but never acknowledged it. It's "just another failure", just another day at the office, nothing unusual here.