[erlang-questions] erlang:monitor() lag time: how long to expect?

Scott Lystig Fritchie fritchie@REDACTED
Thu May 15 02:30:29 CEST 2008


Hi, I've discovered that the lag time between calling erlang:monitor()
and receiving the {'DOWN', ...} message.  I'd like to ask how long is
reasonable to wait?

The proc I'm monitoring is on a remote node, and I'm monitoring it via
erlang:monitor(process, {registered_name_atom(), node_atom()}).  I have
two Erlang nodes, A & B, on two separate physical machines.  Both are
running R11B-5 on top of Linux, "erl -kernel net_ticktime 60 ...".

   1. B is quite busy doing stuff, but it's responding to
      gen_server:call() queries within the default 5 seconds.

   2. On A, I call monitor/2 for a process, my_server_proc, that hasn't
      started yet on B.

   3. 31 seconds later, B starts & registers the proc I want to monitor

   4. 32 seconds later, A gets a {'DOWN', ...} message for step #2's
      monitor.

I suppose I shouldn't be monitoring a proc that hasn't been started
yet.  ("Doctor, it hurts when ...")  And there's a work-around, I
suppose: use rpc:call(node_B, erlang, whereis, [my_server_proc]) to
verify that the server is actually running.

Has anyone else run into seemingly long-delayed {'DOWN', ...} messages?

-Scott

--- snip --- snip --- snip --- snip --- snip --- snip ---

node A : 20080514162806 : make_monitor 1: {my_server_proc,'test@REDACTED'} ref #Ref<0.0.0.247945>

node B : 20080514162837 : progress: [{supervisor,{local,foo_foo_sup}},{started,[{pid,<0.324.0>},{name,my_server_proc},{mfa,{foo_server,start_link,...

node A : 20080514162857 : gen_server:call({my_server_proc,'test@REDACTED'}, bar) returned ok

node A : 20080514162909 : got 'DOWN': my_server_proc Mref #Ref<0.0.0.247945>, Type process, Object {my_server_proc,'test@REDACTED'}, Info noproc




More information about the erlang-questions mailing list