Merge "Kill watchdog thread when engine is stopped"

This commit is contained in:
Jenkins 2014-06-17 00:53:27 +00:00 committed by Gerrit Code Review
commit 9ad24284fe
1 changed files with 7 additions and 3 deletions

View File

@ -74,6 +74,9 @@ class Engine(object):
self._repairs = []
self._known_routing_keys = set()
# Watchdog-related variables
self._watchdog_thread = None
LOG.info('Created engine obj %s', self.name)
# TODO(praneshp): Move to utils?
@ -113,8 +116,8 @@ class Engine(object):
self.futures.append(scheduler)
# watchdog
watchdog_thread = self.start_watchdog()
watchdog_thread.join()
self._watchdog_thread = self.start_watchdog()
self._watchdog_thread.join()
def schedule(self):
while True:
@ -202,7 +205,8 @@ class Engine(object):
self.stop_engine()
def stop_engine(self):
pass
# Stop watchdog monitoring
self._watchdog_thread.stop()
def repair_modified(self):
LOG.info('Repair configuration changed')