File 0145-etop-Extend-timer-when-fetching-process-info-from-no.patch of Package erlang

From aaefd3a001f03f8991983d217e7a7aec945df3a0 Mon Sep 17 00:00:00 2001
From: Siri Hansen <siri@erlang.org>
Date: Fri, 5 May 2017 09:45:01 +0200
Subject: [PATCH] [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.
---
 lib/observer/src/etop.erl | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/observer/src/etop.erl b/lib/observer/src/etop.erl
index 925f4456b..2093e6a0d 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 = 
-- 
2.13.0

openSUSE Build Service is sponsored by