<br><font size=2 face="sans-serif">Hi Netch,</font>
<br>
<br><font size=2 face="sans-serif">Thanks for the hint: I was aware of
net_kernel:connect_node/1 but not of erlang:disconnect_node/1 (a bit confusing
to find them in different places!). </font>
<br>
<br><font size=2 face="sans-serif">My (speculative) point was that </font><tt><font size=2>erlang:monitor_node/0
and net_kernel:monitor_nodes/0 </font></tt><font size=2 face="sans-serif">would
not have prevented 'noconnection' to happen, which I see as a sign that
other processes might be trying to access a node that is being shut down.
</font>
<br>
<br><font size=2 face="sans-serif">On the other end, I did find any process
doing so (yes, this does not imply much!) and I wonder whether rpc:cast(
N, erlang, halt, [] ) could not be a reason sufficient by itself to trigger
a 'noconnection' (doing a local halt() thanks to an idle process already
on the target node never shown any noconnection). That's why I was inquiring
about whether 'noconnection' could be a little bit more talkative or even
catchable (unless I am mistaken, it is not possible?).</font>
<br>
<br><font size=2 face="sans-serif">Anyway at least for my very specific
problem, the issue seems to be closed (at least for the moment!).</font>
<br>
<br><font size=2 face="sans-serif">Thanks!</font>
<br>
<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>netch@segfault.kiev.ua</b>
</font>
<p><font size=1 face="sans-serif">26/04/2012 11:38</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><tt><font size=2> Tue, Apr 24, 2012 at 13:52:18, olivier.boudeville
wrote about "[erlang-questions] Resisting "noconnection"
/ Remote termination of nodes": <br>
<br>
> As I want now these terminations to be synchronous (i.e. I want my
<br>
> terminate function to return only when all nodes are down for sure),
I <br>
> used to rely on checking their termination using net_adm:ping/1 (waiting
<br>
> for pong to become pang), but kept on getting (systematically) <br>
> 'noconnection' errors (exceptions?), which do not seem to be catchable
(at <br>
> least not with a 'try .. catch T:E ->.. end' clause).<br>
<br>
Seems this is good case for erlang:monitor_node(). Initially, check each<br>
node from the list and subscribe to nodedown messages using<br>
monitor_node() if it is shown alive. Then make multicast halt request<br>
and loop around nodedown messages, dropping nodes from list on each one.<br>
Exit on empty list.<br>
Also net_kernel:monitor_nodes() provide similar ability.<br>
<br>
The only side issue I see is that it tries to connect to node if there<br>
is no connection yet, so you one can occur a potential race if some<br>
another agent performs similar action. If this is your case, separate<br>
node control to own manager process.<br>
<br>
> I feel I would need something like net_kernel:unconnect_node/1.<br>
<br>
It's erlang:disconnect_node/1, but I doubt it is useful for your goal.<br>
<br>
> My question now: how to deal gracefully with such a synchronous node
<br>
> shutdown and to resist to the (intended) loss of node(s)? <br>
<br>
Seems something is unclear in your description so feel free to<br>
reformulate it.<br>
<br>
<br>
-netch-<br>
</font></tt>
<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>