<br><font size=2 face="sans-serif">Hi Kannan,</font>
<br>
<br><font size=2 face="sans-serif">Indeed there was already a master node
which, once the termination was agreed upon (consensus is easy to obtain
in my case), was enforcing it, shutting down distributed services synchronously
and in the right order.</font>
<br>
<br><font size=2 face="sans-serif">So the tear-down phase was fully planned,
except that a 'noconnection' error suggested that I had at least one reckless
process that was attempting to reach an already halted node.</font>
<br>
<br><font size=2 face="sans-serif">My question was whether 'noconnection'
was VM-level and uncatchable (not directly triggered by a specific operation
that I could have wrapped in a try/catch clause) and whether we could have
a little more information than just 'noconnection' (source/target node/pid).
</font>
<br>
<br><font size=2 face="sans-serif">Anyway replacing rpc:cast( N, erlang,
halt, [] ) by a direct halt() performed on a process already running on
each node did the trick.<br>
</font>
<br><font size=2 face="sans-serif">Thanks,</font>
<br><font size=2 face="sans-serif">Best regards,</font>
<br><font size=2 face="sans-serif"><br>
Olivier Boudeville.<br>
---------------------------<br>
Olivier Boudeville<br>
<br>
EDF R&D : 1, avenue du Général de Gaulle, 92140 Clamart, France<br>
Département SINETICS, groupe ASICS (I2A), bureau B-226<br>
Office : +33 1 47 65 59 58 / Mobile : +33 6 16 83 37 22 / Fax : +33 1 47
65 27 13</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>vasdeveloper@gmail.com</b>
</font>
<p><font size=1 face="sans-serif">26/04/2012 12:34</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">A</font></div>
<td><font size=1 face="sans-serif">olivier.boudeville@edf.fr</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">erlang-questions@erlang.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td><font size=1 face="sans-serif">Re: [erlang-questions] Resisting "noconnection"
/ Remote termination of nodes</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=3>Hi Olivier,</font>
<br>
<br><font size=3>In distributed computing, we see the collective effort
of individual -- but not independent -- nodes. Communicating
nodes, at any point in time, need to be connected and should have the knowledge
of the other, including the availability status. The OAM node, or leader,
will have the total picture of all the nodes.</font>
<br>
<br><font size=3>You have to look at the bigger picture of the whole system,
when it comes to stopping a distributed system. The following steps are
generally taken to tear down a system.</font>
<br>
<br><font size=3>* Signal all the nodes of a forthcoming shutdown request</font>
<br><font size=3>* Stop accepting new requests</font>
<br><font size=3>* Finish servicing the accepted requests</font>
<br><font size=3>* Do the stock taking and clean-up</font>
<br><font size=3>* Check the readiness of all the nodes for shutdown</font>
<br><font size=3>* Then call shutdown on all the nodes.</font>
<br>
<br><font size=3>Here, I am looking from top into the system. The shutdown
process will be generally coordinated by a single process.</font>
<br>
<br><font size=3>An ad-hock shutdown is more scary to me in a production
environment.</font>
<br>
<br><font size=3>Kind Regards,</font>
<br><font size=3>Kannan.</font>
<br>
<br>
<br>
<br>
<br><font size=3>On Tue, Apr 24, 2012 at 5:22 PM, Olivier BOUDEVILLE <</font><a href=mailto:olivier.boudeville@edf.fr target=_blank><font size=3 color=blue><u>olivier.boudeville@edf.fr</u></font></a><font size=3>>
wrote:</font>
<br><font size=3 face="sans-serif"><br>
Hi,</font><font size=3> <br>
</font><font size=3 face="sans-serif"><br>
For a more controlled overall termination of a distributed application,
I try to shutdown synchronously a series of nodes, as properly and as in
parallel as possible, in a non-OTP program. I imagine that using '[ rpc:cast(
N, erlang, halt, [] ) || N <- MyTargetNodes ]' and then waiting for
them to be terminated is the best approach for that.</font><font size=3>
<br>
</font><font size=3 face="sans-serif"><br>
As I want now these terminations to be synchronous (i.e. I want my terminate
function to return only when all nodes are down for sure), I used to rely
on checking their termination using net_adm:ping/1 (waiting for pong to
become pang), but kept on getting (systematically) 'noconnection' errors
(exceptions?), which do not seem to be catchable (at least not with a 'try
.. catch T:E ->.. end' clause). This happens as soon as there is at
least one node (which happens to be on the same host - of course it is
not the local node from which that rpc:cast is triggered) to halt.</font><font size=3>
<br>
</font><font size=3 face="sans-serif"><br>
I switched to looping on 'lists:member( Nodename, nodes() )' instead of
ping (in both case with a proper waiting between checks), but I still get
'noconnection' errors. It looks like 'noconnection' is VM-level? As expected,
commenting-out the rpc:cast/3 never leads to 'noconnection'. </font><font size=3><br>
</font><font size=3 face="sans-serif"><br>
I feel I would need something like net_kernel:unconnect_node/1.</font><font size=3>
<br>
</font><font size=3 face="sans-serif"><br>
My question now: how to deal gracefully with such a synchronous node shutdown
and to resist to the (intended) loss of node(s)? </font><font size=3><br>
</font><font size=3 face="sans-serif"><br>
Thanks in advance for any hint!</font><font size=3> </font><font size=3 face="sans-serif"><br>
Best regards,</font><font size=3> </font><font size=3 face="sans-serif"><br>
<br>
Olivier.<br>
---------------------------<br>
Olivier Boudeville<br>
<br>
EDF R&D : 1, avenue du Général de Gaulle, 92140 Clamart, France<br>
Département SINETICS, groupe ASICS (I2A), bureau B-226<br>
Office : </font><a href=tel:%2B33%201%2047%2065%2059%2058 target=_blank><font size=3 color=blue face="sans-serif"><u>+33
1 47 65 59 58</u></font></a><font size=3 face="sans-serif"> / Mobile : </font><a href=tel:%2B33%206%2016%2083%2037%2022 target=_blank><font size=3 color=blue face="sans-serif"><u>+33
6 16 83 37 22</u></font></a><font size=3 face="sans-serif"> / Fax : +33
1 47 65 27 13</font>
<p><font size=3><br>
Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis
à l'intention exclusive des destinataires et les informations qui y figurent
sont strictement confidentielles. Toute utilisation de ce Message non conforme
à sa destination, toute diffusion ou toute publication totale ou partielle,
est interdite sauf autorisation expresse.</font>
<p><font size=3>Si vous n'êtes pas le destinataire de ce Message, il vous
est interdit de le copier, de le faire suivre, de le divulguer ou d'en
utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci
de le supprimer de votre système, ainsi que toutes ses copies, et de n'en
garder aucune trace sur quelque support que ce soit. Nous vous remercions
également d'en avertir immédiatement l'expéditeur par retour du message.</font>
<p><font size=3>Il est impossible de garantir que les communications par
messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées
de toute erreur ou virus.<br>
____________________________________________________</font>
<p><font size=3>This message and any attachments (the 'Message') are intended
solely for the addressees. The information contained in this Message is
confidential. Any use of information contained in this Message not in accord
with its purpose, any dissemination or disclosure, either whole or partial,
is prohibited except formal approval.</font>
<p><font size=3>If you are not the addressee, you may not copy, forward,
disclose or use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the sender
immediately by return message.</font>
<p><font size=3>E-mail communication cannot be guaranteed to be timely
secure, error or virus-free.</font>
<p><font size=3><br>
_______________________________________________<br>
erlang-questions mailing list</font><font size=3 color=blue><u><br>
</u></font><a href="mailto:erlang-questions@erlang.org"><font size=3 color=blue><u>erlang-questions@erlang.org</u></font></a><font size=3 color=blue><u><br>
</u></font><a href="http://erlang.org/mailman/listinfo/erlang-questions" target=_blank><font size=3 color=blue><u>http://erlang.org/mailman/listinfo/erlang-questions</u></font></a><font size=3><br>
</font>
<br>
<br><p></p>
<p><br>
Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.</p>
<p>Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.</p>
<p>Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.<br>
____________________________________________________</p>
<p>This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.</p>
<p>If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.</p>
<p>E-mail communication cannot be guaranteed to be timely secure, error or virus-free.</p>