From 56117720565661febf2e11ec77efd71d49f778ae Mon Sep 17 00:00:00 2001 From: Steve Kobes Date: Thu, 13 Sep 2018 18:18:35 +0000 Subject: [PATCH] Increase gerrit_util retry count and delay. Bug: 881860 Change-Id: I6402ff2665b70b46558799dbb16ac9c7a9d7d640 Reviewed-on: https://chromium-review.googlesource.com/1224990 Reviewed-by: Andrii Shyshkalov Commit-Queue: Steve Kobes --- gerrit_util.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gerrit_util.py b/gerrit_util.py index 610d9b30b..f15f6830b 100644 --- a/gerrit_util.py +++ b/gerrit_util.py @@ -32,9 +32,10 @@ import subprocess2 from third_party import httplib2 LOGGER = logging.getLogger() -# With a starting sleep time of 1 second, 2^n exponential backoff, and six -# total tries, the sleep time between the first and last tries will be 31s. -TRY_LIMIT = 6 +# With a starting sleep time of 1.5 seconds, 2^n exponential backoff, and seven +# total tries, the sleep time between the first and last tries will be 94.5 sec. +# TODO(crbug.com/881860): Lower this when crbug.com/877717 is fixed. +TRY_LIMIT = 7 # Controls the transport protocol used to communicate with gerrit. @@ -379,7 +380,7 @@ def ReadHttpResponse(conn, accept_statuses=frozenset([200])): Common additions include 204, 400, and 404. Returns: A string buffer containing the connection's reply. """ - sleep_time = 1 + sleep_time = 1.5 for idx in range(TRY_LIMIT): response, contents = conn.request(**conn.req_params)