8f67ed7d53
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 |
||
---|---|---|
.. | ||
locale/en_GB/LC_MESSAGES | ||
tests | ||
__init__.py | ||
_i18n.py | ||
_options.py | ||
eventlet_backdoor.py | ||
loopingcall.py | ||
periodic_task.py | ||
service.py | ||
sslutils.py | ||
systemd.py | ||
threadgroup.py | ||
version.py | ||
wsgi.py |