Merge lp:~hloeung/ubuntu-repository-cache/metadata-sync-failure-output-ordering into lp:ubuntu-repository-cache

Proposed by Haw Loeung
Status: Merged
Approved by: Paul Collins
Approved revision: 375
Merged at revision: 374
Proposed branch: lp:~hloeung/ubuntu-repository-cache/metadata-sync-failure-output-ordering
Merge into: lp:ubuntu-repository-cache
Diff against target: 54 lines (+6/-4)
2 files modified
lib/ubuntu_repository_cache/metadata_sync.py (+5/-3)
lib/ubuntu_repository_cache/mirror.py (+1/-1)
To merge this branch: bzr merge lp:~hloeung/ubuntu-repository-cache/metadata-sync-failure-output-ordering
Reviewer Review Type Date Requested Status
Paul Collins lgtm Approve
Canonical IS Reviewers Pending
Review via email: mp+428668@code.launchpad.net

Commit message

Bump rsync timeout to reduce metadata age failures & alerts; Fix ordering of errors in output

To post a comment you must log in.
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.

375. By Haw Loeung

Minor fixing

Revision history for this message
Paul Collins (pjdc) :
review: Approve (lgtm)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 374

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-08-17 01:40:08 +0000
3+++ lib/ubuntu_repository_cache/metadata_sync.py 2022-08-21 22:21:33 +0000
4@@ -11,6 +11,7 @@
5 import shutil
6 import socket
7 import subprocess
8+import sys
9 import time
10 import traceback
11
12@@ -307,6 +308,7 @@
13 msg = "{}".format(output)
14 log(msg)
15 except subprocess.CalledProcessError as e:
16+ send_to_influx(render_influx(metric_name, label, attempt))
17 failures = attempt
18 # Save the exact exception and reuse when we need to
19 # reraise it after exhausting all available attempts.
20@@ -318,18 +320,18 @@
21 log(e.output.decode())
22 errmsgs.append("{}: {}".format(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), msg))
23 errmsgs.append(e.output.decode())
24- send_to_influx(render_influx(metric_name, label, attempt))
25 time.sleep(sleep)
26 else:
27 break
28 else:
29+ send_to_influx(render_influx(metric_name, label, max_retries))
30+ print('\n'.join(errmsgs))
31 # Exhausted all available attempts, let's re-raise the
32 # exception.
33 msg = "Failed after all available attempts ({}) with {}".format(max_retries, meta_ver)
34 log(msg)
35 print("{}: {}".format(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), msg))
36- print('\n'.join(errmsgs))
37- send_to_influx(render_influx(metric_name, label, max_retries))
38+ sys.stdout.flush()
39 raise exp
40
41 send_to_influx(render_influx(metric_name, label, failures))
42
43=== modified file 'lib/ubuntu_repository_cache/mirror.py'
44--- lib/ubuntu_repository_cache/mirror.py 2022-07-22 03:55:30 +0000
45+++ lib/ubuntu_repository_cache/mirror.py 2022-08-21 22:21:33 +0000
46@@ -40,7 +40,7 @@
47 '--compress',
48 '--delete',
49 '--delete-before',
50- '--timeout=120',
51+ '--timeout=300',
52 '-e',
53 'sudo -u {} ssh -l {}'.format(user, user),
54 ]

Subscribers

People subscribed via source and target branches