Library for running OpenStack services
Go to file
Davanum Srinivas 6a56ec63bf Fix Heartbeats stop when time is changed
eventlet's hub mechanism defaults to using time.time for figuring
out how long to sleep, when to wake up etc:
https://github.com/eventlet/eventlet/blob/master/eventlet/hubs/epolls.py#L37
https://github.com/eventlet/eventlet/blob/master/eventlet/hubs/hub.py#L344

So if you mess with the system time, anything using loopingcall
will stop working. Best example as described in the bug is
`nova-manage service list` which fails for some services when
the clock is advanced.

If we use a monotonic timer, then we can get past this problem.
In this review we use the EVENTLET_HUB hook to specify
a custom Hub. In our custom Hub, we just delegate to the
existing hub mechanism (get_default_hub()) to create an
instance of the Hub and override the clock with one based
on monotonic.

Note that use_hub() mechanism will not work because that sets
the Hub just for the current thread and will not work for other
threads that may be started later. In order to set this
environment variable early, we set it in the __init__.py so
anyone who uses oslo service will enable this support just
by a simple import referencing anything in oslo.service

Co-Authored-By: Victor Stinner <vstinner@redhat.com>
Closes-Bug: 1510234
Change-Id: I4c1cf223e9f6faa1e6dcaf432be1aa709072a343
2016-03-03 21:21:02 +01:00
doc/source Document graceful_shutdown_timeout config option 2015-10-27 14:42:14 -04:00
oslo_service Fix Heartbeats stop when time is changed 2016-03-03 21:21:02 +01:00
.coveragerc Fix coverage configuration and execution 2015-10-01 19:48:34 +00:00
.gitignore Fix coverage configuration and execution 2015-10-01 19:48:34 +00:00
.gitreview exported from oslo-incubator by graduate.sh 2015-05-21 16:51:40 +03:00
.mailmap exported from oslo-incubator by graduate.sh 2015-05-21 16:51:40 +03:00
.testr.conf exported from oslo-incubator by graduate.sh 2015-05-21 16:51:40 +03:00
CONTRIBUTING.rst exported from oslo-incubator by graduate.sh 2015-05-21 16:51:40 +03:00
HACKING.rst exported from oslo-incubator by graduate.sh 2015-05-21 16:51:40 +03:00
LICENSE exported from oslo-incubator by graduate.sh 2015-05-21 16:51:40 +03:00
README.rst Expand README and clean up intro to sphinx docs 2015-09-25 11:44:57 +00:00
babel.cfg exported from oslo-incubator by graduate.sh 2015-05-21 16:51:40 +03:00
bandit.yaml Add Bandit to tox for security static analysis 2015-12-01 16:10:15 +03:00
requirements.txt Updated from global requirements 2016-02-26 01:52:38 +00:00
setup.cfg Update translation setup 2016-01-29 11:43:28 +01:00
setup.py Updated from global requirements 2015-09-17 12:16:14 +00:00
test-requirements.txt Updated from global requirements 2016-02-04 18:59:10 +00:00
tox.ini Run sslutils and wsgi tests for python3 2015-12-22 13:26:40 +03:00

README.rst

oslo.service -- Library for running OpenStack services

Latest Version

Downloads

oslo.service provides a framework for defining new long-running services using the patterns established by other OpenStack applications. It also includes utilities long-running applications might need for working with SSL or WSGI, performing periodic operations, interacting with systemd, etc.