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