The only reason for importing nova.config now is where one of the
options defined in that file is needed. Rather than importing
nova.config using an import statement, use CONF.import_opt() so
that it is clear which option we actually require.
In future, we will move many options out of nova.config so many
of these import_opt() calls will either go away or cause a module
other than nova.config to be imported.
Change-Id: I0646efddecdf2530903afd50c1f4364cb1d5dce1
Modules import nova.config for two reasons right now - firstly, to
reference nova.config.CONF and, secondly, if they use one of the
options defined in nova.config.
Often modules import nova.openstack.common.cfg and nova.config
which is a bit pointless since they could just use cfg.CONF if
they just want to nova.config in order to reference CONF.
Let's just use cfg.CONF everywhere and we can explicitly state
where we actually require options defined in nova.config.
Change-Id: Ie4184a74e3e78c99658becb18dce1c2087e450bb
nova.flags is no longer needed except to load nova config options shared
across multiple daemons.
This removes nova.flags from the bin programs and makes sure that
nova.flags is imported in nova.config for now.
Change-Id: If066ac0070387bee4b41e6a78ad972f7a0955c75
Use the global CONF variable instead of FLAGS. This is purely a cleanup
since FLAGS is already just another reference to CONF.
We leave the nova.flags imports until a later cleanup commit since
removing them may cause unpredictable problems due to config options not
being registered.
Change-Id: Id0c59b2dc8002ec89ccbc5e5d7986fb68d3a693d
Implements blueprint multi-process-api-service
This is based on Huang Zhiteng's patch.
This patch adds support for running services as multiple processes. This
is primarily intended to be used with the API service as a way to provide
more concurrency than eventlet can sometimes provide.
A SIGTERM or SIGINT signal will cause the parent process to gracefully
terminate the child processes, allowing them to finish processing the
requests currently being processed. The parent will wait for the
children to finish before exiting.
Change-Id: Ie6d6802626eb42d5e64c4167be363fbf6cea2a1b
This reverts commit e599636d09755f635604f64f17e9f56cac14575e
The nova test runner is leaking processes after this change.
Change-Id: Id74463d53f3b7cd749cba293619abef01499b90d
Add multiprocess support for API serivces (EC2/OSAPI_Compute/OSAPI_Volume/Metadata).
2012-06-1 v7:
* Add unittest to cover worker recovery, service termination functionality
in wsgi.py, fix python 2.6 compatibility issue.
* Modify generate_uid() to introduce per-process seeds in utils.py to avoid
collisions.
* Add worker session to nova.conf.sample.
2012-05-21 v6:
* Fix 'test_wsgi' unittest error.
2012-04-28 v5:
* Add SIGINT handler and fix child-parent race condition when Ctrl+C is
pressed.
2012-03-31 v4:
* Fixed typo, removed debug code.
2012-03-30 v3:
* Fixed localization/pep8 error in unittest, add metadata test.
* nova/wsgi.py:Server: use the greenthread pool created for each process.
* nova/service.py: remove debug code
2012-03-27 v2:
* Fixed unittest error.
* nova/wsgi.py:Server: Use self._logger to do logging in multiprocess mode.
* nova/wsgi.py:Server: Move self._pool creation into proper place.
* code style fix.
2012-03-25 v1:
* Modification to nova/service.py and nova/wsgi.py in order to support
multiprocess (a.k.a. workers) for various API services. If multiprocess
mode is enabled, (i.e. flags 'APINAME_workers' set to positive numbers),
corresponding API service will run in target number of process(es). There
is also a master_worker process spawned for managing all workers (handling
signal/termination).
* Add unittest for multiprocess API service, also alter testing/runner.py
to adopt new unittest.
Change-Id: Ia045e595543ddfd192894b2a05801cc4b7ca90cb
Implements blueprint cfg-global-object
Replace nova.flags.FLAGS with openstack.common.cfg.CONF.
In future, we can do a s/FLAGS/CONF/ across the codebase.
Change-Id: Ib293873089a5399febd7a3b0410f66e9bef115f1
Implements blueprint remove-old-flagfile
nova-manage can still be used to convert old flagfiles style files
to new .ini files:
$ ./bin/nova-manage config convert --help
Usage: nova-manage config convert <args> [options]
Options:
-h, --help show this help message and exit
--infile=<path> old-style flagfile to convert to config
--outfile=<path> path for output file. Writes configto stdout if not
specified.
Change-Id: Ib8fbbd858b1db7faef70d7d97955e5042bf378f2
Signed-off-by: Ghe Rivero <ghe@debian.org>