<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Roberto,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">This is the expected behavior. Note that the nodes will automatically reconnect by default when either node has a process that sends a message to a process on the remote node. This reconnection behavior can be modified by setting the kernel's 'dist_auto_connect' option.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Other applications (such as mnesia) may require custom recovery from a network split, which is one of the reasons why automatic reconnection may not be desirable.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Regards,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Serge</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 22, 2016 at 5:39 AM, Roberto Ostinelli <span dir="ltr"><<a href="mailto:roberto@widetag.com" target="_blank">roberto@widetag.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear list,<div>A simple question: am I correct that, when a node is removed because of a net split, you need to have your own application logic to reconnect to it, and nothing in the VM will try doing that for you?</div><div><br></div><div>Let me show you an example. I have two nodes: <a href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a> and <a href="mailto:2@127.0.0.1" target="_blank">2@127.0.0.1</a> that are connected to each other:</div><div><br></div><div><div><font face="monospace, monospace">(<a href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a>)1> nodes().</font></div><div><font face="monospace, monospace">['<a href="mailto:2@127.0.0.1" target="_blank">2@127.0.0.1</a>']</font></div></div><div><br></div><div>On node 2 I listen for nodedown events of node 1:</div><div><br></div><div><font face="monospace, monospace">(<a href="mailto:2@127.0.0.1" target="_blank">2@127.0.0.1</a>)1> monitor_node('<a href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a>', true).<br></font></div><div><font face="monospace, monospace">true</font></div><div><br></div><div>On node 1, I simulate a net splits with the best option I've found until now, i.e suspending the net_kernel process:</div><div><br></div><div><font face="monospace, monospace">(<a href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a>)2> sys:suspend(net_kernel).<br></font></div><div><font face="monospace, monospace">ok</font></div><div><br></div><div>After ~60 seconds on node 2 I get:</div><div><br></div><div><div><font face="monospace, monospace">=ERROR REPORT==== 22-Apr-2016::11:28:21 ===</font></div><div><font face="monospace, monospace">** Node '<a href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a>' not responding **</font></div><div><font face="monospace, monospace">** Removing (timedout) connection **</font></div></div><div><div><font face="monospace, monospace">(<a href="mailto:2@127.0.0.1" target="_blank">2@127.0.0.1</a>)2> flush().</font></div><div><font face="monospace, monospace">Shell got {nodedown,'<a href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a>'}</font></div></div><div><br></div><div>Now the two nodes are disconnected:</div><div><br></div><div><div><font face="monospace, monospace">(<a href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a>)3> nodes().</font></div><div><font face="monospace, monospace">[]</font></div></div><div><br></div><div><span style="font-family:monospace,monospace">(<a href="mailto:2@127.0.0.1" target="_blank">2@127.0.0.1</a>)3> nodes().</span><br></div><div><div><font face="monospace, monospace">[]</font></div></div><div><br></div><div>Even when I resume the net_kernel process:</div><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">(<a href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a>)4> sys:resume(net_kernel). </font></div><div><font face="monospace, monospace">ok</font></div></div><div><br></div><div>The nodes do not reconnect:</div><div><br></div><div><div><font face="monospace, monospace">(<a href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a>)5> nodes().</font></div><div><font face="monospace, monospace">[]</font></div></div><div><br></div><div>I'm ok with this, though I would like to confirm that my understanding is correct.</div><div>If so, does everyone just implement some standard connection manager that does only reconnections?</div><div><br></div><div>Thank you,</div><div>r.</div><div><br></div><div><br></div><div><br></div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>