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:
Cédric Krier
2025-03-07 21:54:11 +01:00
parent 1e5fa01e63
commit e9cd9d1163
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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: