<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">This is in CloudI (in cloudi_core) as
      shown at <a class="moz-txt-link-freetext" href="http://cloudi.org/api.html#2_nodes_set">http://cloudi.org/api.html#2_nodes_set</a> with
      reconnect_start and reconnect_delay determining the interval for
      checking the node connections.  If you need help using
      cloudi_core, that is at
      <a class="moz-txt-link-freetext" href="https://github.com/CloudI/CloudI/tree/master/examples/hello_world5">https://github.com/CloudI/CloudI/tree/master/examples/hello_world5</a>
      .<br>
      <br>
      On 04/22/2016 04:42 AM, Roberto Ostinelli wrote:<br>
    </div>
    <blockquote
cite="mid:CAM5fRyphMEMXkhsFWte_+JaL5w0q0Fn9qaO5LHOheA=pB0Pcog@mail.gmail.com"
      type="cite">
      <div dir="ltr">Thank you both for confirming.
        <div>Hence I guess some kind of a basic reconnection manager
          might be helpful here.</div>
        <div><br>
        </div>
        <div>Thanks!</div>
        <div><br>
        </div>
        <div>r.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Fri, Apr 22, 2016 at 12:35 PM, Serge
          Aleynikov <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:serge@aleynikov.org" target="_blank">serge@aleynikov.org</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">
              <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">
                <div>
                  <div class="h5">On Fri, Apr 22, 2016 at 5:39 AM,
                    Roberto Ostinelli <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:roberto@widetag.com"
                        target="_blank">roberto@widetag.com</a>></span>
                    wrote:<br>
                  </div>
                </div>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div>
                    <div class="h5">
                      <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 moz-do-not-send="true"
                            href="mailto:1@127.0.0.1" target="_blank">1@127.0.0.1</a>
                          and <a moz-do-not-send="true"
                            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
                                moz-do-not-send="true"
                                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
                                moz-do-not-send="true"
                                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
                              moz-do-not-send="true"
                              href="mailto:2@127.0.0.1" target="_blank">2@127.0.0.1</a>)1>
                            monitor_node('<a moz-do-not-send="true"
                              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
                              moz-do-not-send="true"
                              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 moz-do-not-send="true"
                                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
                                moz-do-not-send="true"
                                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 moz-do-not-send="true"
                                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
                                moz-do-not-send="true"
                                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
                              moz-do-not-send="true"
                              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
                                moz-do-not-send="true"
                                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
                                moz-do-not-send="true"
                                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>
                    </div>
                  </div>
                  _______________________________________________<br>
                  erlang-questions mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:erlang-questions@erlang.org"
                    target="_blank">erlang-questions@erlang.org</a><br>
                  <a moz-do-not-send="true"
                    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>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>