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 |
||
---|---|---|
.. | ||
ssl_cert | ||
__init__.py | ||
base.py | ||
eventlet_service.py | ||
test_eventlet_backdoor.py | ||
test_loopingcall.py | ||
test_periodic.py | ||
test_service.py | ||
test_sslutils.py | ||
test_systemd.py | ||
test_threadgroup.py | ||
test_wsgi.py |