Fix memory leak reloading triggers

Because the triggers are loaded to the scheduler and not an object
of a pipeline they aren't reset when reloading. They are reused
by the new pipeline, however any previously loaded triggers will
still have an old connection object that should no longer be used.

Instead reset the triggers when reloading causing new triggers to be
created by the pipeline configuration against the new connection objects.

The connection objects that were hanging around for old triggers were
keeping their change cache and hence using up a lot of memory.

It appears that maintainTriggerCache is only called when reloading,
so the cache would have a habit of growing out of hand and, in particular,
if you don't ever reload it will not be maintained. A followup to run
the cache at sensible times will come.

Change-Id: I81ee47524cda71a500c55a95a2280f491b1b63d9
This commit is contained in:
Joshua Hesketh 2016-02-03 14:22:15 +11:00
parent 514db293af
commit 90b61dbde8
1 changed files with 1 additions and 0 deletions

View File

@ -263,6 +263,7 @@ class Scheduler(threading.Thread):
def _unloadDrivers(self):
for trigger in self.triggers.values():
trigger.stop()
self.triggers = {}
for pipeline in self.layout.pipelines.values():
pipeline.source.stop()
for action in self._reporter_actions.values():