[erlang-questions] net_adm:ping_list/1 and the scary comment above it

Björn Gustavsson bjorn@REDACTED
Mon May 26 11:56:02 CEST 2014

On Thu, May 22, 2014 at 3:28 PM, Martin Schürrer <martin@REDACTED> 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.


Björn Gustavsson, Erlang/OTP, Ericsson AB

More information about the erlang-questions mailing list