Merge "Fix shutdown ordering"
This commit is contained in:
commit
4a8694f5f9
@ -146,13 +146,13 @@ class TaskManager:
|
||||
while True:
|
||||
task = self.queue.get()
|
||||
if not task:
|
||||
if not self._running:
|
||||
break
|
||||
continue
|
||||
self.log.debug("Manager %s running task %s (queue %s)" %
|
||||
(self.name, task.name, self.queue.qsize()))
|
||||
task.run(self)
|
||||
self.queue.task_done()
|
||||
if not self._running:
|
||||
break
|
||||
except Exception:
|
||||
self.log.exception("Task manager died")
|
||||
raise
|
||||
|
@ -893,8 +893,6 @@ class NodePool(threading.Thread):
|
||||
# completed before we continue the shutdown.
|
||||
if self.isAlive():
|
||||
self.join()
|
||||
if self.config:
|
||||
provider_manager.ProviderManager.stopProviders(self.config)
|
||||
|
||||
if self._cleanup_thread:
|
||||
self._cleanup_thread.stop()
|
||||
@ -917,6 +915,10 @@ class NodePool(threading.Thread):
|
||||
self.log.debug("Waiting for %s" % thd.name)
|
||||
thd.join()
|
||||
|
||||
# Stop providers after all the cleanup threads have stopped.
|
||||
if self.config:
|
||||
provider_manager.ProviderManager.stopProviders(self.config)
|
||||
|
||||
if self.zk:
|
||||
self.zk.disconnect()
|
||||
self.log.debug("Finished stopping")
|
||||
|
Loading…
x
Reference in New Issue
Block a user