You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some connections which can go down for a while, but I want to keep checking (once per minute, e.g.) until they become reachable again. Supposedly, I can do this with the maxDelay parameter of backoffPolicy.
After a while, though, instead of continuing to re-try, policy will start raising an exception:
Jul 02 12:59:22 [8534]: File ".../python3.6/site-packages/automat/_methodical.py", line 135, in _connectionFailed
Jul 02 12:59:22 [8534]: value = output(oself, *args, **kwargs)
Jul 02 12:59:22 [8534]: File ".../python3.6/site-packages/automat/_methodical.py", line 169, in __call__
Jul 02 12:59:22 [8534]: return self.method(oself, *args, **kwargs)
Jul 02 12:59:22 [8534]: File ".../python3.6/site-packages/twisted/application/internet.py", line 740, in _ignoreAndWait
Jul 02 12:59:22 [8534]: return self._doWait()
Jul 02 12:59:22 [8534]: File ".../python3.6/site-packages/twisted/application/internet.py", line 744, in _doWait
Jul 02 12:59:22 [8534]: delay = self._timeoutForAttempt(self._failedAttempts)
Jul 02 12:59:22 [8534]: File ".../python3.6/site-packages/twisted/application/internet.py", line 520, in policy
Jul 02 12:59:22 [8534]: return min(initialDelay * (factor ** attempt), maxDelay) + jitter()
Jul 02 12:59:22 [8534]: builtins.OverflowError: (34, 'Numerical result out of range')
(Some pathnames sanitized.) A little investigation shows that once the attempt count exceeds 1750, the intermediate result is too large to represent in a float, and so even though it will be discarded and replaced by maxDelay this will cause retries to fail:
>>> factor = 1.5
>>> (factor ** 1750)
1.4444527745742028e+308
>>> (factor ** 1751)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: (34, 'Numerical result out of range')
This will take only a couple of days at maxDelay=60.0: less than a weekend.
I have some connections which can go down for a while, but I want to keep checking (once per minute, e.g.) until they become reachable again. Supposedly, I can do this with the
maxDelay
parameter ofbackoffPolicy
.After a while, though, instead of continuing to re-try,
policy
will start raising an exception:(Some pathnames sanitized.) A little investigation shows that once the
attempt
count exceeds 1750, the intermediate result is too large to represent in afloat
, and so even though it will be discarded and replaced bymaxDelay
this will cause retries to fail:This will take only a couple of days at
maxDelay=60.0
: less than a weekend.Versions:
Searchable metadata
The text was updated successfully, but these errors were encountered: