oslo.service/oslo_service
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
..
locale/en_GB/LC_MESSAGES Imported Translations from Zanata 2016-06-04 07:07:59 +00:00
tests Add min_interval to BackOffLoopingCall 2017-04-25 17:13:46 +00:00
__init__.py Fix Heartbeats stop when time is changed 2016-03-03 21:21:02 +01:00
_i18n.py Remove log translations 2017-03-23 16:04:59 +08:00
_options.py Merge "wsgi: decrease the default number of greenthreads in pool" 2016-02-24 05:30:42 +00:00
eventlet_backdoor.py Remove log translations 2017-03-23 16:04:59 +08:00
loopingcall.py Add min_interval to BackOffLoopingCall 2017-04-25 17:13:46 +00:00
periodic_task.py Remove log translations 2017-03-23 16:04:59 +08:00
service.py Merge "Fix some reST field lists in docstrings" 2017-03-29 10:34:34 +00:00
sslutils.py Add Bandit to tox for security static analysis 2015-12-01 16:10:15 +03:00
systemd.py Fix argument type for _sd_notify() on python3 2016-03-31 10:51:19 -06:00
threadgroup.py Remove log translations 2017-03-23 16:04:59 +08:00
version.py pbr.version.VersionInfo needs package name (oslo.xyz and not oslo_xyz) 2017-02-06 12:49:21 -05:00
wsgi.py Remove log translations 2017-03-23 16:04:59 +08:00