Library for running OpenStack services
Go to file
melanie witt 8f67ed7d53 Add min_interval to BackOffLoopingCall
The backoff timer has a few issues that can cause it to get stuck
in an infinite loop and never time out.

  1. The random.gauss() function used to generate random jitter can
     return negative values, so when it does, it makes the elapsed time
     self._error_time go "backward."
  2. The random jitter is used as a multiplier for the self._interval,
     so self._interval can deviate far away from the mean over time and
     walk to zero, causing self._interval to be 0, which will prevent
     the timer from making progress from that point on because idle
     will always evaluate to zero and the elapsed time won't increase.
  3. The evaluated interval doesn't have a lower bound, so over time
     it can get extremely small if jitter (the mean) < 0.5.

This adds a min_interval keyword argument to the BackOffLoopingCall
start() function that defaults to 0.001s and uses it to lower bound
the interval calculations. We'll also take the absolute value of the
return from random.gauss() to prevent elapsed time going backward, and
we'll calculate the running self._interval separately to make it track
the desired growth rate of the backoff and not let it drift with the
random.gauss() values.

Closes-Bug: #1686159

Change-Id: Id17668a34d5cedbe870c9056350a7e9c7196faa7
2017-04-25 17:13:46 +00:00
doc/source [Trivial] Remove executable privilege of doc/source/conf.py 2016-04-29 20:15:35 +08:00
oslo_service Add min_interval to BackOffLoopingCall 2017-04-25 17:13:46 +00:00
releasenotes Update reno for stable/ocata 2017-01-20 19:15:56 +00:00
tools Add Constraints support 2016-12-20 14:23:59 +11:00
.coveragerc Update .coveragerc after the removal of respective directory 2016-10-18 17:45:44 +05:30
.gitignore Add reno for release notes management 2016-06-30 10:02:49 +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 Show team and repo badges on README 2016-11-25 13:25:56 +01: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 2017-04-01 15:31:57 +00:00
setup.cfg Use Sphinx 1.5 warning-is-error 2017-03-22 13:26:14 +00:00
setup.py Updated from global requirements 2017-03-03 00:03:22 +00:00
test-requirements.txt Updated from global requirements 2017-03-03 00:03:22 +00:00
tox.ini Remove references to Python 3.4 2017-01-17 10:37:12 -08:00

README.rst

Team and repository tags

image

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.