net_adm:ping_list/1 and the scary comment above it

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

net_adm:ping_list/1 and the scary comment above it

Martin Carlson-2
Was looking through the Erlang/OTP source yesterday and found
net_adm:ping_list/1 which isn't documented but has a really scary comment:

https://github.com/erlang/otp/blob/maint/lib/kernel/src/net_adm.erl#L117-L132

%% A common situation in "life" is to have a configuration file with a list
%% of nodes, and then at startup, all nodes in the list are ping'ed
%% this can lead to no end of troubles if two disconnected nodes
%% simultaneously ping each other.
%% Use this function in order to do it safely.
%% It assumes a working global.erl which ensures a fully
%% connected network.
%% Had the erlang runtime system been able to fully cope with
%% the possibility of two simultaneous (unix) connects, this function would
%% merley  be lists:map({net_adm, ping}, [], Nodelist).
%% It is also assumed, that the same (identical) Nodelist is given to all
%% nodes which are to perform this call (possibly simultaneously).
%% Even this code has a flaw, and that is the case where two
%% nodes simultaneously and without *any* other already
%% running nodes execute this code. :-(

It's been in there since at least R13B03 when Erlang moved to git.

Can someone enlighten me if I should take that warning seriously?

Kind regards,
Martin Schuerrer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140522/e5997275/attachment.html>

Reply | Threaded
Open this post in threaded view
|

net_adm:ping_list/1 and the scary comment above it

Josh Adams
>
>
> Can someone enlighten me if I should take that warning seriously?
>
> Kind regards,
> Martin Schuerrer
>

I'd love to know the answer too.  Surely it can't be accurate, but if so it
should surely be rm'ed as well right?

-Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140523/b54d541e/attachment.html>

Reply | Threaded
Open this post in threaded view
|

net_adm:ping_list/1 and the scary comment above it

Anthony Ramine-2
In reply to this post by Martin Carlson-2
It was already in R6B-0.

--
Anthony Ramine

Le 22 mai 2014 ? 15:28, Martin Sch?rrer <martin> a ?crit :

> It's been in there since at least R13B03 when Erlang moved to git.
>


Reply | Threaded
Open this post in threaded view
|

net_adm:ping_list/1 and the scary comment above it

Björn Gustavsson-3
In reply to this post by Martin Carlson-2
On Thu, May 22, 2014 at 3:28 PM, Martin Sch?rrer <martin> wrote:

> Was looking through the Erlang/OTP source yesterday and found
> net_adm:ping_list/1 which isn't documented but has a really scary comment:
>
> https://github.com/erlang/otp/blob/maint/lib/kernel/src/net_adm.erl#L117-L132
>
> %% A common situation in "life" is to have a configuration file with a list
> %% of nodes, and then at startup, all nodes in the list are ping'ed
> %% this can lead to no end of troubles if two disconnected nodes
> %% simultaneously ping each other.
> %% Use this function in order to do it safely.
> %% It assumes a working global.erl which ensures a fully
> %% connected network.
> %% Had the erlang runtime system been able to fully cope with
> %% the possibility of two simultaneous (unix) connects, this function would
> %% merley  be lists:map({net_adm, ping}, [], Nodelist).
> %% It is also assumed, that the same (identical) Nodelist is given to all
> %% nodes which are to perform this call (possibly simultaneously).
> %% Even this code has a flaw, and that is the case where two
> %% nodes simultaneously and without *any* other already
> %% running nodes execute this code. :-(
>
> It's been in there since at least R13B03 when Erlang moved to git.

I haven't checked, but I think I saw the comment in R1 too.

> Can someone enlighten me if I should take that warning seriously?

I think that all bugs having to do with simultaneous connects
have been fixed a long time ago.

/Bjorn

--
Bj?rn Gustavsson, Erlang/OTP, Ericsson AB