6a56ec63bf
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 |
||
---|---|---|
doc/source | ||
oslo_service | ||
.coveragerc | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.testr.conf | ||
CONTRIBUTING.rst | ||
HACKING.rst | ||
LICENSE | ||
README.rst | ||
babel.cfg | ||
bandit.yaml | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini |
README.rst
oslo.service -- Library for running OpenStack services
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.
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/oslo.service
- Source: http://git.openstack.org/cgit/openstack/oslo.service
- Bugs: http://bugs.launchpad.net/oslo.service