Increase delay between transaction retries
Since c8771e45b861 the retry is no more a countdown but an increasing count, so the sleep time must be adapted to also increase over retries. Closes #13910
This commit is contained in:
@@ -201,7 +201,7 @@ def _dispatch(request, pool, *args, **kwargs):
|
||||
transaction_extras = {}
|
||||
while True:
|
||||
if count:
|
||||
time.sleep(0.02 * (retry - count))
|
||||
time.sleep(0.02 * count)
|
||||
with Transaction().start(
|
||||
pool.database_name, user,
|
||||
readonly=rpc.readonly, timeout=rpc.timeout,
|
||||
|
||||
@@ -246,7 +246,7 @@ def with_transaction(readonly=None, user=0, context=None, timeout=None):
|
||||
transaction_extras = {}
|
||||
while True:
|
||||
if count:
|
||||
time.sleep(0.02 * (retry - count))
|
||||
time.sleep(0.02 * count)
|
||||
with Transaction().start(
|
||||
pool.database_name, user_, readonly=readonly_,
|
||||
context=context_, timeout=timeout,
|
||||
|
||||
@@ -145,7 +145,7 @@ def run_task(pool, task_id):
|
||||
transaction_extras = {}
|
||||
while True:
|
||||
if count:
|
||||
time.sleep(0.02 * (retry - count))
|
||||
time.sleep(0.02 * count)
|
||||
with Transaction().start(
|
||||
pool.database_name, 0,
|
||||
**transaction_extras) as transaction:
|
||||
|
||||
Reference in New Issue
Block a user