From: Gorka Eguileor Date: Tue, 16 Feb 2016 18:20:46 +0000 (+0100) Subject: Propoerly call oslo's Service stop and wait X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=6daa6ad3f528330d97b85c3eebfc494fc07a2f95;p=openstack-build%2Fcinder-build.git Propoerly call oslo's Service stop and wait We are not calling oslo_service.Service's stop method with the graceful parameter which ensure that stop waits for threads to properly stop instead of just forcefully stopping them. This is not an issue for Cinder at this moment because the rpcserver.stop call waits for everything to gracefully stop, but we may have something there running and we wouldn't want to kill it. We should also call oslo_service.Service.wait method from our Service.wait method. This patch ensures that we are properly calling oslo_Service.Service's methods. Change-Id: I8764571c41509fdf1ff7950e9d8d7d6cf0d2f57d --- diff --git a/cinder/service.py b/cinder/service.py index 6054da6c5..650d75f63 100644 --- a/cinder/service.py +++ b/cinder/service.py @@ -277,7 +277,7 @@ class Service(service.Service): x.stop() except Exception: self.timers_skip.append(x) - super(Service, self).stop() + super(Service, self).stop(graceful=True) def wait(self): skip = getattr(self, 'timers_skip', []) @@ -289,6 +289,7 @@ class Service(service.Service): pass if self.rpcserver: self.rpcserver.wait() + super(Service, self).wait() def periodic_tasks(self, raise_on_error=False): """Tasks to be run at a periodic interval."""