From 8f4973fa786e402c132e9d4a09192813917860d2 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Wed, 27 Sep 2017 17:15:07 +0000 Subject: [PATCH] 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 --- zun/cmd/compute.py | 1 - zun/common/rpc_service.py | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/zun/cmd/compute.py b/zun/cmd/compute.py index 0c6df988e..96e3554e7 100644 --- a/zun/cmd/compute.py +++ b/zun/cmd/compute.py @@ -42,5 +42,4 @@ def main(): server = rpc_service.Service.create(CONF.compute.topic, CONF.host, endpoints, binary='zun-compute') launcher = service.launch(CONF, server) - server.create_periodic_tasks() launcher.wait() diff --git a/zun/common/rpc_service.py b/zun/common/rpc_service.py index ef16e7072..3b6649943 100644 --- a/zun/common/rpc_service.py +++ b/zun/common/rpc_service.py @@ -60,9 +60,6 @@ class Service(service.Service): profiler.setup(binary, CONF.host) def start(self): - self._server.start() - - def create_periodic_tasks(self): servicegroup.setup(CONF, self.binary, self.tg) periodic.setup(CONF, self.tg) for endpoint in self.endpoints: @@ -71,6 +68,7 @@ class Service(service.Service): periodic_interval_max=CONF.periodic_interval_max, context=context.get_admin_context(all_tenants=True) ) + self._server.start() def stop(self): if self._server: