Merge pull request #3204 from kreuzert/exponential_backoff_overflow_exception

Prevent OverflowErrors in exponential_backoff()
This commit is contained in:
Min RK
2020-10-15 10:39:28 +02:00
committed by GitHub

View File

@@ -173,7 +173,8 @@ async def exponential_backoff(
# this prevents overloading any single tornado loop iteration with
# too many things
dt = min(max_wait, remaining, random.uniform(0, start_wait * scale))
scale *= scale_factor
if dt < max_wait:
scale *= scale_factor
await gen.sleep(dt)
raise TimeoutError(fail_message)