Change-ID I80487f559302b0e88953835ffb4a3bfe2a347501 introduces
oslo.service into Cinder. The graceful shutdown of RPC server
was introduced via merging of oslo.service.
Actual fix was introduced by https://review.openstack.org/#/c/190175/
into oslo.service.
The oslo.service fix provides this facility through it's wait()
method, so we need to call it in Cinder Service wait() method
which gets called when graceful shutdown is requested by sending
the process SIGTERM.
Change-Id: Iea877e062272103ea48583b5638dec6174e99de0
Closes-Bug:
1464822
self.timers = []
setup_profiler(binary, host)
+ self.rpcserver = None
def start(self):
version_string = version.version_string()
# errors, go ahead and ignore them.. as we're shutting down anyway
try:
self.rpcserver.stop()
- self.rpcserver.wait()
except Exception:
pass
for x in self.timers:
x.wait()
except Exception:
pass
+ if self.rpcserver:
+ self.rpcserver.wait()
def periodic_tasks(self, raise_on_error=False):
"""Tasks to be run at a periodic interval."""
)
serv.start()
serv.stop()
+ serv.wait()
serv.rpcserver.start.assert_called_once_with()
serv.rpcserver.stop.assert_called_once_with()
serv.rpcserver.wait.assert_called_once_with()