[openstack-dev] [oslo][oslo-service] Multi main processes are started by using oslo_service

zhi changzhi1990 at gmail.com
Tue Jun 27 09:56:04 UTC 2017

Hi, all.

    Here, I want to start a main process and multi subprocess by using
oslo_service. So I launch a service like this:

    from oslo_service import service as common_service

    def serve_wsgi(cls):
            service = cls.create()
        except Exception:
            with excutils.save_and_reraise_exception():

        return service

    class ApiService(WsgiService):
    """Class for tacker-api service."""

    def create(cls, app_name='abc'):
        service = cls(app_name)
        return service

    api = service.serve_wsgi(service.ApiService)
    launcher = common_service.launch(cfg.CONF, api,
                                         workers=cfg.CONF.api_workers or

Everything goes well when the "api_workers " equals 0 or 1. But two main
processes were started when the " api_workers " equals 2. The log shows

2017-06-27 17:42:18.864 1958058 INFO abc.common.wsgi [-] (1958058) wsgi
starting up on

2017-06-27 17:42:18.864 1958059 INFO abc.common.wsgi [-] (1958059) wsgi
starting up on

Could someone tell me the reason why two main processes were started ?

Zhi Chang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20170627/a11ff4fa/attachment.html>

More information about the OpenStack-dev mailing list