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):
        try:
            service = cls.create()
        except Exception:
            with excutils.save_and_reraise_exception():
            LOG.exception(''......')

        return service

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

    @classmethod
    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
None)
    launcher.wait()

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
below:

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

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


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


Thanks
Zhi Chang
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to