From 3d0829b704e9e191875c192c3d985720bfbfde24 Mon Sep 17 00:00:00 2001 From: gordon chung Date: Mon, 1 Feb 2016 13:10:02 -0500 Subject: [PATCH] fix metricd workers metricd is incorrectly configured to ignore true tasks of MetricProcessing and MetricReporting processes. this corrects it. Change-Id: I4dbfbb4e05bbbd86a92abce0944e5de23581cef9 --- gnocchi/cli.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gnocchi/cli.py b/gnocchi/cli.py index 74f77fb0..56a761c8 100644 --- a/gnocchi/cli.py +++ b/gnocchi/cli.py @@ -71,13 +71,17 @@ class MetricProcessBase(multiprocessing.Process): while True: try: with timeutils.StopWatch() as timer: - self.store.process_background_tasks(self.index) + self._run_job() time.sleep(max(0, self.interval_delay - timer.elapsed())) except KeyboardInterrupt: # Ignore KeyboardInterrupt so parent handler can kill # all children. pass + @staticmethod + def _run_job(): + raise NotImplementedError + class MetricReporting(MetricProcessBase): def _run_job(self): @@ -93,12 +97,11 @@ class MetricReporting(MetricProcessBase): class MetricProcessor(MetricProcessBase): def _run_job(self): - LOG.debug("Processing new measures") - try: - self.store.process_measures(self.index) - except Exception: - LOG.error("Unexpected error during measures processing", - exc_info=True) + try: + self.store.process_background_tasks(self.index) + except Exception: + LOG.error("Unexpected error during measures processing", + exc_info=True) def metricd():