Merge lp:~hloeung/ubuntu-repository-cache/increase-juju-run-retries into lp:ubuntu-repository-cache

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: 366
Merged at revision: 366
Proposed branch: lp:~hloeung/ubuntu-repository-cache/increase-juju-run-retries
Merge into: lp:ubuntu-repository-cache
Diff against target: 21 lines (+2/-2)
1 file modified
lib/ubuntu_repository_cache/metadata_sync.py (+2/-2)
To merge this branch: bzr merge lp:~hloeung/ubuntu-repository-cache/increase-juju-run-retries
Reviewer Review Type Date Requested Status
Paul Collins lgtm Approve
Canonical IS Reviewers Pending
Review via email: mp+428050@code.launchpad.net

Commit message

Increase retries on juju-run failures to reduce issues with incomplete metadata sync

We do this by increasing the no. of retries as well as the time to sleep before next retry.

To post a comment you must log in.
Revision history for this message
Paul Collins (pjdc) :
review: Approve (lgtm)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 366

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/ubuntu_repository_cache/metadata_sync.py'
2--- lib/ubuntu_repository_cache/metadata_sync.py 2022-07-28 01:56:44 +0000
3+++ lib/ubuntu_repository_cache/metadata_sync.py 2022-08-08 22:22:33 +0000
4@@ -295,7 +295,7 @@
5
6 # Work around Juju instability issues causing juju-run to abort
7 # (LP:1977798).
8- max_retries = 5
9+ max_retries = 10
10 for attempt in range(1, max_retries):
11 try:
12 check_call(cmd, stdout=subprocess.DEVNULL)
13@@ -304,7 +304,7 @@
14 # reraise it after exhausting all available attempts.
15 exp = e
16 # Exponential backoff.
17- sleep = attempt * random.randint(1, 60)
18+ sleep = attempt * random.randint(10, 60)
19 log("Attempt {} failed, sleeping {} - retrying with {}".format(attempt, sleep, meta_ver))
20 metric_name = 'ubuntu_repository_cache_metadata_sync_failures'
21 label = 'meta_ver={}'.format(meta_ver)

Subscribers

People subscribed via source and target branches