Comment 8 for bug 1321303

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/94737
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=507555a585d22a6dc276344b7b97fa9a015e81e5
Submitter: Jenkins
Branch: master

commit 507555a585d22a6dc276344b7b97fa9a015e81e5
Author: Steven Hardy <email address hidden>
Date: Tue May 27 16:18:06 2014 +0100

    Move Engine initialization into service start()

    Currently we create the ThreadGroupManager and EngineListener
    objects in the service constructor, which is not necessarily
    going to work if multiple worker processes are specified in
    the config file (which fork multiple workers after the constructor).

    The ThreadGroupManager appears to work, even when it is created before
    the fork, but this is due to some magic in the oslo ProcessLauncher
    implementation which decouples parent/child use of the eventlet hub.

    So instead, we move all service startup code into the start() method,
    which is the entry point for services, triggered via the oslo Services
    class run_service method:

    - Don't create anything common to the workers in the constructor
    - Move ThreadGroup and EngineListener creation into start()
    - Create the periodic tasks from bin/heat-engine, which means
      the periodic tasks will only be created by the parent, not
      duplicated in every worker process.

    These changes should mean we work correctly with both the ServiceLauncher
    (num_engine_workers==1) and ProcessLauncher(num_engine_workers>1) oslo
    abstractions, and solves the issues observed when running multiple
    workers with the impl_qpid rpc_backend.

    Change-Id: If3a11050a03660560a364dec871f85c4b56c1c25
    Closes-Bug: #1321303