[erlang-questions] net_kernel:monitor_nodes and DOWN message guarantees

Lukas Larsson lukas@REDACTED
Tue Nov 8 15:43:04 CET 2016


Hello,

On Mon, Nov 7, 2016 at 1:11 PM, José Valim <jose.valim@REDACTED>
wrote:

> Given a process in node 'A' that calls net_kernel:monitor_nodes() and a
> node 'B'.
>
> * If node 'B' reconnects intermittently, is it guaranteed {nodedown,
> 'B'} is always delivered **before** an eventual {nodeup, 'B'}?
>

No. The two connections are considered two different concurrent entities,
so the same message ordering guarantees as normal apply, i.e. none in this
case.


>
> * If the same process in node 'A' that calls net_kernel:monitor_nodes()
> also monitors a pid in node 'B', is it guaranteed the 'DOWN' messages for
> such pid are delivered **before** {nodedown, 'B'}?
>

Yes. The monitor_nodes() up/down messages enclose the connection, so all
traffic (be it down, broken links, messages etc) are guaranteed to be
inbetween the up and down of that connection.


>
> I am in particular looking for the transitive property that if A monitors
> a process in B and B reconnects, the 'DOWN' messages are delivered before
> nodeup.
>

So no, that is not guaranteed.

Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161108/4d43625a/attachment.htm>


More information about the erlang-questions mailing list