Erlang节点无响应。

4

我在erlang控制台上首次接收到这样的消息@localhost节点。

=ERROR REPORT==== 1-Jan-2011::23:19:28 ===
** Node 'second@localhost' not responding **
** Removing (timedout) connection **

我的问题是 - 在这种情况下超时是什么?在多长时间内会导致此事件发生? 如何防止这种“恐怖”情况?我只能通过重新启动节点来恢复正常工作... 但是什么是正确的方法?

谢谢,新年快乐!

1个回答

9
在Erlang源代码中搜索“not responding”字符串,您可以看到该消息是在kernel应用程序的dist_util模块中生成的(con_loop函数)。请注意保留HTML标记。
    {error, not_responding} ->
        error_msg("** Node ~p not responding **~n"
              "** Removing (timedout) connection **~n",
              [Node]),

在该模块中,包含以下文档,解释了ticks和未响应节点背后的逻辑:

%%
%% Send a TICK to the other side.
%%
%% This will happen every 15 seconds (by default) 
%% The idea here is that every 15 secs, we write a little 
%% something on the connection if we haven't written anything for 
%% the last 15 secs.
%% This will ensure that nodes that are not responding due to 
%% hardware errors (Or being suspended by means of ^Z) will 
%% be considered to be down. If we do not want to have this  
%% we must start the net_kernel (in erlang) without its 
%% ticker process, In that case this code will never run 

%% And then every 60 seconds we also check the connection and 
%% close it if we havn't received anything on it for the 
%% last 60 secs. If ticked == tick we havn't received anything 
%% on the connection the last 60 secs. 

%% The detection time interval is thus, by default, 45s < DT < 75s 

%% A HIDDEN node is always (if not a pending write) ticked if 
%% we haven't read anything as a hidden node only ticks when it receives 
%% a TICK !! 

希望这能有所帮助。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接