[erlang-questions] net_adm:ping_list/1 and the scary comment above it
Martin Schürrer
martin@REDACTED
Thu May 22 15:28:48 CEST 2014
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.htm>
More information about the erlang-questions
mailing list