Erlang doesn't detect net splits by itself. You could start looking at net_kernel:set_net_ticktime/2 (try to increase this value if your node is suffering from high load/traffic) and kernel/src/dist_utils.erl to get a grasp how erlang handles node connections.<br>
<br>Martynas<br><br><div class="gmail_quote">On Thu, May 24, 2012 at 6:23 PM, David Mercer <span dir="ltr"><<a href="mailto:dmercer@gmail.com" target="_blank">dmercer@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal">(Yes, I am still working on my issue with a distributed application that keeps losing its connection to the other node.)<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">It is not a problem only when I have 2 nodes on the <i>same</i> host.  I was running the nodes on <i>different</i> hosts last night, and this morning the failover node had lost its connection to the main and so had started its own instance of the application.  Calling <span style="font-family:Consolas">nodes()</span> on the failover returned <span style="font-family:Consolas">[]</span>.<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Then I started a new node on the same host as the main (to see if it would restore the connections), and, yes, it did.  After starting the third node, <span style="font-family:Consolas">nodes() </span>now on the failover node returns a list of two nodes, the two on the main host.  However, the application on the failover node did not shut down, and so it is still running on both the main and failover nodes.<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">To summarize:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p><u></u><span>1.<span style="font:7.0pt "Times New Roman"">       </span></span><u></u>Distributed application running on a node on host A (“main@A”), failover on node on host B (“failover@B”).<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p><p><u></u><span>2.<span style="font:7.0pt "Times New Roman"">       </span></span><u></u>At some point, <i>failover@B</i> becomes disconnected from <i>main@A</i>, and the application starts on <i>failover@B</i>.  Now there are two instances of the application running.<u></u><u></u></p>

<p><u></u> <u></u></p><p><u></u><span>3.<span style="font:7.0pt "Times New Roman"">       </span></span><u></u>From a network point of view, there is still (or again) a valid network connection between hosts A and B.  I can’t say for sure if some network/firewall/other issue caused a temporary disconnect, but I can say that by the time I got in this morning, when the application was running on both nodes, there was a firm network connection between the two hosts.<u></u><u></u></p>

<p><u></u> <u></u></p><p><u></u><span>4.<span style="font:7.0pt "Times New Roman"">       </span></span><u></u>Calling <span style="font-family:Consolas">nodes()</span> on <i>failover@B</i> returns <span style="font-family:Consolas">[]</span>.<u></u><u></u></p>

<p><u></u> <u></u></p><p><u></u><span>5.<span style="font:7.0pt "Times New Roman"">       </span></span><u></u>A new (failover) node was started on host A (“failover@A”).  It does not start the application (which is correct, since it is already running, albeit on <i>both</i> other nodes instead of just one).<u></u><u></u></p>

<p><u></u> <u></u></p><p><u></u><span>6.<span style="font:7.0pt "Times New Roman"">       </span></span><u></u>Calling <span style="font-family:Consolas">nodes()</span> on <i>failover@B</i> now returns <span style="font-family:Consolas">[failover@A,main@A]</span>.<u></u><u></u></p>

<p><u></u> <u></u></p><p><u></u><span>7.<span style="font:7.0pt "Times New Roman"">       </span></span><u></u>The application, however, is still running on <i>failover@B</i>, despite the fact that nodes/0 reports a connection to <i>main@A</i>.<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I don’t need someone to diagnose this for me.  If someone could just educate me a little on how the connections work, how net splits are detected and nodes disconnected, etc., I might be able to take it from there.  Anyone know enough and have the time to type out a little blurb?  I can read source code, but having a little background knowledge would help put it into context for me.<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thank-you!<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Cheers,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">

David<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br>