summaryrefslogtreecommitdiffstats
path: root/openstack/common/service.py
Commit message (Collapse)AuthorAgeFilesLines
* Enable hacking H402 testSergey Lukjanov2013-06-031-1/+1
| | | | | | H402 one line docstring needs punctuation Change-Id: Ie848453cace318d8310cdf0234c512f4c1121119
* Pass backdoor_port to services being launchedBrian Elliott2013-05-091-1/+2
| | | | Change-Id: I7227648f9b9e1d3e30f4b2d03964ee5c625a1024
* Use oslo-config-2013.1b3Mark McLoughlin2013-02-171-1/+1
| | | | | | | | | | | | | | | The cfg API is now available via the oslo-config library, so switch to it and remove the copied-and-pasted version. Add the 2013.1b3 tarball to tools/pip-requires - this will be changed to 'oslo-config>=2013.1' when oslo-config is published to pypi. This will happen in time for grizzly final. Remove the 'deps = pep8==1.3.3' and 'deps = pyflakes' from tox.ini as it means all the other deps get installed with easy_install which can't install oslo-config from the URL. Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
* ThreadGroup remove unused name parametersSteven Hardy2013-01-161-2/+2
| | | | | | | | | | Thread/ThreadGroup constructors take a name parameter which is never used, so we can simplify things a bit by removing it. If anything is referencing the internal self.name it should be using its own name->threadgroup mapping (e.g via a dict or similar container class) Change-Id: I6877a2fcee60ce9fc087d38aa492d7c9d50ce97e Signed-off-by: Steven Hardy <shardy@redhat.com>
* Implement importutils.try_import.Dan Prince2013-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | Adds a new (simple) importutils.try_import function which can return a module name or a default (by default this is None). This should help clean up some of our try: import foo except... blocks in modules. This commit also drops the dependency on python-extras which is no longer needed. Fixes LP Bug #1099501. Change-Id: I8591f79983bdad67a50d1aaae6dce8428dfce084
* Don't rely on os.wait() blockingDavanum Srinivas2013-01-021-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | Before this fix which was included in eventlet 0.10.0: https://bitbucket.org/which_linden/eventlet/issue/92/eventletgreen-override-of-oswaitpid the os.wait() wrapper in eventlet would not block if no child processes had exited. This was clearly buggy behaviour and os.wait() no blocks correctly. However, it appears it now does not return if the parent process was interrupted by a signal. This means that you can't kill the parent process and have the child processes cleaned up gracefully. To avoid all these issues, switch to non-blocking wait behaviour. We use WNOHANG with waitpid() to poll for an exited child process and, if there is none, we yield to other green threads and sleep for a short period. This means excessive CPU usage, though, which will be tracked by bug #1095346. Check pid to avoid some unnecessary warning/info messages in the logs Fixes LP #1094076 Change-Id: I783fac652376c2daa9d591403b9f4c1fe9523043
* Use Service thread group for WSGI request handlingDavanum Srinivas2012-11-291-2/+2
| | | | | | | | | | | | | | | - Reuse the pool from thread group in service.Service instead of creating a new green pool - Add ability to control the size of the pool in service.Service - Add a couple of tests for wsgi.Service() to test the size of pool a start/stop as well - Get rid of the wait method by using tg.add_thread - Get rid of pool in wsgi.Service - Added explicit property for host and port Fixes LP #1050379 Change-Id: I40507dc7887fb036ec594bb167cdaa42c278607e
* Make project pyflakes clean.Monty Taylor2012-11-281-2/+5
| | | | | | | | | | | | | Added both a tox test-env for pyflakes and fixed the current pyflakes errors. This did actually fix a couple of bugs. The CI team has started using pyflakes on its projects and also has started using oslo for things, so ignoring pyflakes warnings on the oslo code was starting to get old. However, additionally, pyflakes is pretty solid, so we should maybe consider gating on it across the board. (% locals() is the biggest thing that we do that it doesn't like) Change-Id: Iac1ca62db301892b7863711162fcbc74807eb24f
* Replace try: import with extras.try_importMonty Taylor2012-11-281-5/+2
| | | | | | | | | | | | | | | The block form: try: import foo except: foo = None is confusing to code analysis tools looking for redefinition. It's also a common enough pattern that someone else has encoded it into a library. Let's use that instead. Change-Id: I35a5c7a7e3595a51ba1ef1886c3965f463dba04a
* Merge "Use the ThreadGroup for the Launcher"Jenkins2012-11-191-11/+4
|\
| * Use the ThreadGroup for the LauncherAngus Salkeld2012-11-131-11/+4
| | | | | | | | | | | | Avoid duplicate code. Change-Id: I06523f846e851b2e5766a7a9b078f728c0755c5f
* | Change RPC cleanup orderingJeff Peeler2012-11-121-1/+1
|/ | | | | | | | | RPC cleanup should occur before killing service threadgroup. Otherwise, the connection pool is going to be (attempted) emptied after the thread has been killed. Change-Id: Ie2b2aca495928b7ba39b2175202a072b3592ad72 Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
* Merge "Use spawn_n when not capturing return value"Jenkins2012-11-051-1/+1
|\
| * Use spawn_n when not capturing return valueEric Windisch2012-11-041-1/+1
| | | | | | | | | | | | If not capturing the return value, spawn_n is more efficient. Change-Id: Ie6baa934e81e17e2d73f70766628d4bc97b7aa5e
* | Log CONF from ProcessLauncher.wait, like ServiceLauncherDavid Ripton2012-10-311-0/+4
| | | | | | | | | | | | | | | | | | | | Fixes bug #1050380 In the unit tests, we need to call CONF so that the config-file option referenced by log_opt_values() is registered. We also need unregister the default_publisher_id option to workaround bug #107372. Change-Id: Icc63237ddf97aaa730c0484974ec05a3080f8f04
* | Import order clean-upZhongyue Luo2012-10-291-1/+1
|/ | | | | | Reorder imports by full module path Change-Id: If619b4b50aa052401f7fa65df57b74d4ad1b65a6
* Added a missing `cfg` import in service.pyKiall Mac Innes2012-10-021-0/+2
| | | | Change-Id: I7e98686cb72ba6287b93746267390cc79f18bb6d
* Log config on startupAngus Salkeld2012-09-261-0/+4
| | | | | | | Part of blueprint service-infrastructure Change-Id: I60698800231e5de349fdbcf9f9090e5b31727640 Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
* Integrate eventlet backdoorMark McLoughlin2012-09-261-0/+2
| | | | | | Part of blueprint service-infrastructure Change-Id: Ia0511ae62497d95771ca3a894379486741e223ba
* Add the rpc service and delete managerAngus Salkeld2012-09-261-25/+9
| | | | | | Part of blueprint service-infrastructure Change-Id: Ie00efcb1c974d699ac6b2a38285abef1b295f3ce
* Add threadgroup to manage timers and greenthreads.Angus Salkeld2012-08-201-7/+23
| | | | | | | Part of blueprint service-infrastructure Change-Id: I40593b6ad13d99d9e63c8c04154a0dac5aced02e Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
* Add multiprocess service launcherAngus Salkeld2012-08-201-7/+183
| | | | | | | Part of blueprint service-infrastructure Signed-off-by: Angus Salkeld <asalkeld@redhat.com> Change-Id: I848e8c91d2c331e5c78a176258318457a9041131
* Add signal handling to service launcherAngus Salkeld2012-08-201-0/+41
| | | | | | | Part of blueprint service-infrastructure Change-Id: Iff072199ebd3c1abcb4218c9b647f8bef75f934a Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
* Basic service launching infrastructureAngus Salkeld2012-08-151-0/+73
| | | | | | | Part of blueprint service-infrastructure Change-Id: I4e97db2877be976b0c681da9ff0d331fbfb306b0 Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
* Move manager.py and service.py into common.Angus Salkeld2012-08-151-0/+30
- Just start with the skeleton classes. Part of blueprint service-infrastructure Change-Id: I90fbff3805455d9d82aacf43257d74e4cb443042 Signed-off-by: Angus Salkeld <asalkeld@redhat.com>