]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add logging to debug oslo.messaging failure
authorDoug Hellmann <doug@doughellmann.com>
Fri, 14 Aug 2015 22:30:46 +0000 (22:30 +0000)
committerCedric Brandily <zzelle@gmail.com>
Tue, 18 Aug 2015 10:06:06 +0000 (12:06 +0200)
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

neutron/service.py

index 4cec3357078159930ff469f2baeed304ce23387a..6b1eee248b19d3af10cc59a8eef695cad1c7cd8e 100644 (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)