aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2017-05-05 09:45:01 +0200
committerSiri Hansen <[email protected]>2017-05-08 16:41:58 +0200
commitaaefd3a001f03f8991983d217e7a7aec945df3a0 (patch)
tree892c917a25b13dbff438daeec7786561c8c14b82
parent1ca124231e0a2ee0db3cb5ff993d7615e573bdfa (diff)
downloadotp-aaefd3a001f03f8991983d217e7a7aec945df3a0.tar.gz
otp-aaefd3a001f03f8991983d217e7a7aec945df3a0.tar.bz2
otp-aaefd3a001f03f8991983d217e7a7aec945df3a0.zip
[etop] Extend timer when fetching process info from node
Originally, etop would only wait for 1 second after starting the collection of process info from the observed node. If data was not received in time, etop would exit with reason 'connection_lost'. In some cases, however, this timer would expire due to the amount of processes on the observed node. To avoid this, the timer is now extended to the same as the update interval, which means that if the problem occurs, it can be helped by extending the interval time.
-rw-r--r--lib/observer/src/etop.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/observer/src/etop.erl b/lib/observer/src/etop.erl
index 925f4456bb..2093e6a0d7 100644
--- a/lib/observer/src/etop.erl
+++ b/lib/observer/src/etop.erl
@@ -180,10 +180,16 @@ stop(Opts) ->
end,
unregister(etop_server).
-update(#opts{store=Store,node=Node,tracing=Tracing}=Opts) ->
+update(#opts{store=Store,node=Node,tracing=Tracing,intv=Interval}=Opts) ->
Pid = spawn_link(Node,observer_backend,etop_collect,[self()]),
Info = receive {Pid,I} -> I
- after 1000 -> exit(connection_lost)
+ after Interval ->
+ %% Took more than the update interval to fetch
+ %% data. Either the connection is lost or the
+ %% fetching took too long...
+ io:format("Timeout when waiting for process info from "
+ "node ~p; exiting~n", [Node]),
+ exit(timeout)
end,
#etop_info{procinfo=ProcInfo} = Info,
ProcInfo1 =