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 Mergebot (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 Mergebot (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
1diff --git a/files/mirror-1stage.sh b/files/mirror-1stage.sh
2index 0f97175..f578059 100755
3--- a/files/mirror-1stage.sh
4+++ b/files/mirror-1stage.sh
5@@ -68,6 +68,15 @@ else
6 url=${SOURCE_URL}
7 fi
8
9+# If upstream is close to us and triggers us via ssh, we may start
10+# syncing before it has deleted its local lock file, which then
11+# becomes a "file has vanished" and non-zero exit, causing the trace
12+# file to not update, which makes the mirror seem stale when it isn't.
13+# Therefore, let's just:
14+log "== Sleeping to allow upstream delete its lock file =="
15+sleep 5
16+
17+log "== Syncing files from source =="
18 rsync --verbose --recursive --times --links --hard-links \
19 --stats --delete --delete-before \
20 --exclude "${lockfile}" --exclude ".trace/${role}-${myhostname}" \
21diff --git a/files/mirror-2stage.sh b/files/mirror-2stage.sh
22index 3a4ebc9..0d19e55 100755
23--- a/files/mirror-2stage.sh
24+++ b/files/mirror-2stage.sh
25@@ -68,6 +68,14 @@ else
26 url=${SOURCE_URL}
27 fi
28
29+# If upstream is close to us and triggers us via ssh, we may start
30+# syncing before it has deleted its local lock file, which then
31+# becomes a "file has vanished" and non-zero exit, causing the trace
32+# file to not update, which makes the mirror seem stale when it isn't.
33+# Therefore, let's just:
34+log "== Sleeping to allow upstream delete its lock file =="
35+sleep 5
36+
37 log "== Syncing files from source - first stage =="
38 rsync --verbose --recursive --times --links --hard-links \
39 --stats \

Subscribers

People subscribed via source and target branches