Merge ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:sleep-for-lockfile-deletion into ubuntu-mirror-charm:master

Proposed by Paul Collins
Status: Merged
Approved by: Paul Collins
Approved revision: 2efb17a251a78f49544f53937122ebf0aa9fe97b
Merged at revision: 8057430070364561c903b9c058f9dc0698b7c2ba
Proposed branch: ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:sleep-for-lockfile-deletion
Merge into: ubuntu-mirror-charm:master
Diff against target: 39 lines (+17/-0)
2 files modified
files/mirror-1stage.sh (+9/-0)
files/mirror-2stage.sh (+8/-0)
Reviewer Review Type Date Requested Status
Haw Loeung +1 Approve
Canonical IS Reviewers Pending
Review via email: mp+392023@code.launchpad.net

Commit message

sleep for 5 seconds before we starting mirroring to let upstream delete its lock file

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.

Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM

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

Change successfully merged at revision 8057430070364561c903b9c058f9dc0698b7c2ba

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/files/mirror-1stage.sh b/files/mirror-1stage.sh
index 0f97175..f578059 100755
--- a/files/mirror-1stage.sh
+++ b/files/mirror-1stage.sh
@@ -68,6 +68,15 @@ else
68 url=${SOURCE_URL}68 url=${SOURCE_URL}
69fi69fi
7070
71# If upstream is close to us and triggers us via ssh, we may start
72# syncing before it has deleted its local lock file, which then
73# becomes a "file has vanished" and non-zero exit, causing the trace
74# file to not update, which makes the mirror seem stale when it isn't.
75# Therefore, let's just:
76log "== Sleeping to allow upstream delete its lock file =="
77sleep 5
78
79log "== Syncing files from source =="
71rsync --verbose --recursive --times --links --hard-links \80rsync --verbose --recursive --times --links --hard-links \
72 --stats --delete --delete-before \81 --stats --delete --delete-before \
73 --exclude "${lockfile}" --exclude ".trace/${role}-${myhostname}" \82 --exclude "${lockfile}" --exclude ".trace/${role}-${myhostname}" \
diff --git a/files/mirror-2stage.sh b/files/mirror-2stage.sh
index 3a4ebc9..0d19e55 100755
--- a/files/mirror-2stage.sh
+++ b/files/mirror-2stage.sh
@@ -68,6 +68,14 @@ else
68 url=${SOURCE_URL}68 url=${SOURCE_URL}
69fi69fi
7070
71# If upstream is close to us and triggers us via ssh, we may start
72# syncing before it has deleted its local lock file, which then
73# becomes a "file has vanished" and non-zero exit, causing the trace
74# file to not update, which makes the mirror seem stale when it isn't.
75# Therefore, let's just:
76log "== Sleeping to allow upstream delete its lock file =="
77sleep 5
78
71log "== Syncing files from source - first stage =="79log "== Syncing files from source - first stage =="
72rsync --verbose --recursive --times --links --hard-links \80rsync --verbose --recursive --times --links --hard-links \
73 --stats \81 --stats \

Subscribers

People subscribed via source and target branches