Add logging to debug oslo.messaging failure

It looks like recent changes to oslo.messaging master are conflicting
with changes in neutron master with the way RPC services are started
when the rpc_workers value == 0.

Change-Id: Iea2197ad0ea9ceb9a2a850a9e03e53b4b39ca288
This commit is contained in:
Doug Hellmann 2015-08-14 22:30:46 +00:00 committed by Cedric Brandily
parent 29a8d6b62f
commit b5eef0e266
1 changed files with 18 additions and 0 deletions

View File

@ -118,13 +118,27 @@ class RpcWorker(common_service.ServiceBase):
self._servers = self._plugin.start_rpc_listeners()
def wait(self):
try:
self._wait()
except Exception:
LOG.exception(_LE('done with wait'))
raise
def _wait(self):
LOG.debug('calling RpcWorker wait()')
for server in self._servers:
if isinstance(server, rpc_server.MessageHandlingServer):
LOG.debug('calling wait on %s', server)
server.wait()
else:
LOG.debug('NOT calling wait on %s', server)
LOG.debug('returning from RpcWorker wait()')
def stop(self):
LOG.debug('calling RpcWorker stop()')
for server in self._servers:
if isinstance(server, rpc_server.MessageHandlingServer):
LOG.debug('calling stop on %s', server)
server.stop()
@staticmethod
@ -151,12 +165,16 @@ def serve_rpc():
rpc = RpcWorker(plugin)
if cfg.CONF.rpc_workers < 1:
LOG.debug('starting rpc directly, workers=%s',
cfg.CONF.rpc_workers)
rpc.start()
return rpc
else:
# dispose the whole pool before os.fork, otherwise there will
# be shared DB connections in child processes which may cause
# DB errors.
LOG.debug('using launcher for rpc, workers=%s',
cfg.CONF.rpc_workers)
session.dispose()
launcher = common_service.ProcessLauncher(cfg.CONF,
wait_interval=1.0)