Kill watchdog thread when engine is stopped
Step 1 of stopping the engine via api. Stop the watchdog thread, so we don't do anymore monitoring. Change-Id: I3d78834ab3cf81643260a47efec7c738f7a2f63f
This commit is contained in:
parent
b41ea8a81f
commit
4e4533796b
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue