Commit Graph

86 Commits

Author SHA1 Message Date
Andrew Bogott d335457f48 Switch to common logging.
I only just moved logging from nova to common, so behavior should remain the same.

Change-Id: I1d7304ca200f9d024bb7244d25be2f9a670318fb
2012-07-02 15:57:09 -05:00
Johannes Erdfelt 46c1b6eaee Add multi-process support for API services
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
2012-06-28 19:57:37 +00:00
James E. Blair 626f64a716 Revert "blueprint <multi-process-api-service>"
This reverts commit e599636d09

The nova test runner is leaking processes after this change.

Change-Id: Id74463d53f3b7cd749cba293619abef01499b90d
2012-06-04 22:19:10 -07:00
Zhiteng Huang e599636d09 blueprint <multi-process-api-service>
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
2012-06-02 00:34:55 +08:00
Mark McLoughlin 00786bc554 Use cfg's new global CONF object
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
2012-05-30 21:24:53 +01:00
Ghe Rivero 7e3e9b8e9c Remove old flagfile support.
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>
2012-05-10 19:17:34 +02:00
Nachi Ueno 9059902c72 Merged with trunkw 2011-08-19 13:25:49 -07:00
Nachi Ueno c06bbe9973 Added monkey patching notification code function
w
2011-08-19 12:30:55 -07:00
Vishvananda Ishaya 125a2affec more cleanup of binaries per review 2011-08-18 10:55:39 -07:00
Vishvananda Ishaya 6cdee85905 Make all services use the same launching strategy 2011-08-17 16:25:53 -07:00
Josh Kearney 209bf1ef49 Add a flag to disable ec2 or osapi. 2011-07-08 17:12:14 -05:00
Nikolay Sokolov 6b6fd2fe87 PEP8 passed. 2011-07-06 01:31:04 +04:00
Nikolay Sokolov c3229ec37f Formatting fix. 2011-07-06 01:09:00 +04:00
Nikolay Sokolov fde44cdf69 Signal handler cleanup, proper ^C handling. 2011-07-06 00:24:55 +04:00
Nikolay Sokolov 1732c373aa Gracefull shutdown of nova-api. 2011-07-04 23:48:05 +04:00
Josh Kearney 834b1741b4 Use milestone cut. 2011-06-28 17:26:08 -05:00
Brian Lamar 655a783d5a Created Bootstrapper to handle Nova bootstrapping logic. 2011-06-23 21:31:00 -04:00
Mark Washenberger 2059a683e1 run launcher first since it initializes global flags and logging 2011-06-22 23:27:49 -04:00
Brian Lamar e821b96feb Removed unneeded import. 2011-06-21 00:32:31 -04:00
Brian Lamar c17c73b3d0 Tests for WSGI/Launcher 2011-06-21 00:21:33 -04:00
Brian Lamar e849aa7112 Removed logging logic from __init__, added concept of Launcher...no tests for it yet. 2011-06-20 19:32:18 -04:00
Brian Lamar c178b3ce44 pep8 fixes 2011-06-20 14:54:53 -04:00
Brian Lamar dd870291a3 Cleanup and addition of tests for WSGI server. 2011-06-20 10:12:43 -04:00
Brian Lamar 927aecb0a3 Introduced Loader concept, for paste decouple. 2011-06-19 20:18:29 -04:00
Brian Lamar 79402ffbae Cleanup of the cleanup. 2011-06-19 18:00:38 -04:00
Brian Lamar 1e047dae71 Further nova-api cleanup. 2011-06-19 16:27:46 -04:00
Brian Lamar 95213244fe Cleaned up nova-api binary and logging a bit. 2011-06-19 14:41:42 -04:00
Brian Lamar ea64f883b7 Removed debugging, made objectstore tests pass again. 2011-06-19 14:09:09 -04:00
Brian Lamar 843644aed6 General cleanup and refactor of a lot of the API/WSGI service code. 2011-06-18 23:10:41 -04:00
Brian Lamar 6e9a95fe81 disable-msg -> disable 2011-03-18 09:56:05 -04:00
Justin Santa Barbara a4830f83af Sorted imports correctly 2011-03-08 16:45:20 -08:00
Justin Santa Barbara e69c802aaf Moved FLAGS.paste_config to its re-usable location 2011-03-07 15:36:04 -08:00
Justin Santa Barbara be54e37bbd Merged with trunk and fixed conflict. Sigh. 2011-03-07 15:30:58 -08:00
Justin Santa Barbara 8e0fd37ddf Converted tabs to spaces in bin/nova-api 2011-03-07 15:22:59 -08:00
Justin Santa Barbara f65867673e Merge with trunk, resolve conflicts and refactor 2011-03-07 14:34:02 -08:00
Kevin L. Mitchell f72366f007 Create --paste_config flag defaulting to api-paste.ini and mv etc/nova-api.conf to match 2011-03-07 19:33:24 +00:00
Vishvananda Ishaya 3368b32338 use default flagfile in nova-api 2011-02-25 12:16:58 -08:00
termie 3115a65f99 add help back to the scripts that don't use service.py 2011-02-23 15:26:52 -08:00
Justin Santa Barbara fbfc2b2165 Alphabetize imports 2011-02-23 15:17:32 -08:00
Justin Santa Barbara 50e71cef14 Removed unused import & formatting cleanups 2011-02-22 18:59:23 -08:00
Justin Santa Barbara dd6b9c21d3 Exit with exit code 1 if conf cannot be read 2011-02-22 18:57:04 -08:00
Justin Santa Barbara e37e7b91a9 Support service-like wait behaviour for API service 2011-02-22 17:58:01 -08:00
Justin Santa Barbara b6254db80c Refactoring nova-api to be a service, so that we can reuse it in tests 2011-02-22 17:45:38 -08:00
Thierry Carrez f80d4c859b Merged trunk 2011-02-22 17:16:43 +01:00
Vishvananda Ishaya f9f9bf52f5 Add flags for listen_port to nova-api. This allows us to listen on one port, but return another port (for a proxy or load balancer) in calls like describe_regions, etc. 2011-02-22 15:34:47 +00:00
Vishvananda Ishaya 3125d978fe use a different flag for listen port for apis 2011-02-21 23:26:03 -08:00
Vishvananda Ishaya 29644fe5a9 switch to explicit call to logging.setup() 2011-02-21 13:46:41 -08:00
Vishvananda Ishaya 86b202f739 fix nova-api as well 2011-02-21 00:17:58 -08:00
Vishvananda Ishaya eaddb9ea52 remove extra references to logging.basicConfig 2011-02-20 23:36:36 -08:00
Thierry Carrez 15d140992a PEP8 fix 2011-02-18 16:23:52 +01:00