Revert "Avoid running periodic tasks on all workers"

This patch makes zun-compute takes a long time to response
to SIGTERM signal. As a result, each restart will take a
long time (about 40 seconds). Let's revert this patch first
and re-propose it for merging if the problem is resolved.

This reverts commit ad64e8df1ccb8891fb0cec9c7fe0396c5cb769df.

Closes-Bug: #1722296
Change-Id: I6b14544e9753c3d0981608af376cde08153fed59
This commit is contained in:
Hongbin Lu 2017-09-27 17:15:07 +00:00 committed by Hongbin Lu
parent ad64e8df1c
commit 8f4973fa78
2 changed files with 1 additions and 4 deletions

View File

@ -42,5 +42,4 @@ def main():
server = rpc_service.Service.create(CONF.compute.topic, CONF.host, server = rpc_service.Service.create(CONF.compute.topic, CONF.host,
endpoints, binary='zun-compute') endpoints, binary='zun-compute')
launcher = service.launch(CONF, server) launcher = service.launch(CONF, server)
server.create_periodic_tasks()
launcher.wait() launcher.wait()

View File

@ -60,9 +60,6 @@ class Service(service.Service):
profiler.setup(binary, CONF.host) profiler.setup(binary, CONF.host)
def start(self): def start(self):
self._server.start()
def create_periodic_tasks(self):
servicegroup.setup(CONF, self.binary, self.tg) servicegroup.setup(CONF, self.binary, self.tg)
periodic.setup(CONF, self.tg) periodic.setup(CONF, self.tg)
for endpoint in self.endpoints: for endpoint in self.endpoints:
@ -71,6 +68,7 @@ class Service(service.Service):
periodic_interval_max=CONF.periodic_interval_max, periodic_interval_max=CONF.periodic_interval_max,
context=context.get_admin_context(all_tenants=True) context=context.get_admin_context(all_tenants=True)
) )
self._server.start()
def stop(self): def stop(self):
if self._server: if self._server: