Skip to content

Commit edcb441

Browse files
anubhabsenmarco-c
andauthored
exponential backoff with tenacity (#513)
* exponential backoff with tenacity * fixes lints Co-authored-by: Marco Castelluccio <[email protected]>
1 parent 6e6f608 commit edcb441

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

bot/code_coverage_bot/taskcluster.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ def download_artifact(artifact_path, task_id, artifact_name):
7272
logger.debug("Downloading artifact", url=url)
7373

7474
@tenacity.retry(
75-
reraise=True, wait=tenacity.wait_fixed(30), stop=tenacity.stop_after_attempt(5)
75+
reraise=True,
76+
wait=tenacity.wait_exponential(multiplier=1, min=16, max=64),
77+
stop=tenacity.stop_after_attempt(5),
7678
)
7779
def perform_download():
7880
r = requests.get(url, stream=True)

bot/code_coverage_bot/uploader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def gcp_covdir_exists(repository, revision, platform, suite):
6363

6464

6565
@tenacity.retry(
66-
stop=tenacity.stop_after_attempt(10), wait=tenacity.wait_fixed(60), reraise=True
66+
stop=tenacity.stop_after_attempt(10),
67+
wait=tenacity.wait_exponential(multiplier=1, min=16, max=64),
68+
reraise=True,
6769
)
6870
def gcp_ingest(repository, revision, platform, suite):
6971
"""

report/firefox_code_coverage/codecoverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _save_tasks(response):
7676

7777
@tenacity.retry(
7878
stop=tenacity.stop_after_attempt(5),
79-
wait=tenacity.wait_incrementing(start=7, increment=7),
79+
wait=tenacity.wait_exponential(multiplier=1, min=16, max=64),
8080
reraise=True,
8181
)
8282
def download_binary(url, path):

0 commit comments

Comments
 (0)