OpenTSDB / tcollector

Data collection framework for OpenTSDB
http://opentsdb.net
GNU Lesser General Public License v3.0
513 stars 359 forks source link

EOS collector doesn't clear jsonrpclib history #388

Closed dasturias closed 5 years ago

dasturias commented 6 years ago

Due to this issue in jsonrpclib https://github.com/joshmarshall/jsonrpclib/issues/47 if the jsonrpclib history is not cleared memory will grow unbounded. The fix is to add history.clear() after every call. Sample diff here:

diff --git a/eos/collectors/eos.py b/eos/collectors/eos.py
index 86da378..c3bd436 100755
--- a/eos/collectors/eos.py
+++ b/eos/collectors/eos.py
@@ -33,6 +33,7 @@ class IntfCounterCollector(object):
       result = self.server_.runCmds(1, ["show interfaces counters",
                                         "show interfaces counters errors",
                                         "show interfaces counters bins"])
+      jsonrpclib.history.clear()
       (counters, error_counters, bin_counters) = result

       # Print general interface counters 
xavierhardy commented 6 years ago

This issue has been fixed and should be closed.