Thanks to visit codestin.com
Credit goes to github.com

Skip to content

EOS collector doesn't clear jsonrpclib history #388

@dasturias

Description

@dasturias

Due to this issue in jsonrpclib joshmarshall/jsonrpclib#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 

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions