aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2004-12-28 13:50:37 +0800
committerkris <kris@FreeBSD.org>2004-12-28 13:50:37 +0800
commitdd61bdccb1b0364ee4260b32833ceb2ec00ee13b (patch)
tree4500c12cb880351486ffbc7627d87cbf5d3323a1
parente6b8fe7b7074dd0194bec5563ac4e7d1fb9134fa (diff)
downloadfreebsd-ports-gnome-dd61bdccb1b0364ee4260b32833ceb2ec00ee13b.tar.gz
freebsd-ports-gnome-dd61bdccb1b0364ee4260b32833ceb2ec00ee13b.tar.zst
freebsd-ports-gnome-dd61bdccb1b0364ee4260b32833ceb2ec00ee13b.zip
* Support the -norsync argument to only remove the existing build chroots
on a disconnected client, without running the time-consuming rsyncs. This is useful when a build is interrupted and needs to be restarted. * After we have cleaned up the machine, reset the queue counter by using pollmachine -queue. This has a race condition if other builds are being dispatched to the machine (e.g. builds on another branch): getmachine can claim a directory and increment the counter, then the machine is polled and finds e.g. 0 chroots in use, and resets the counter to 0, then claim-chroot is run and the build dispatched, with the counter now off-by-one. This could be fixed by running claim-chroot with the .lock held, but this turns out to be too time-consuming. A two-level lock approach might also fix this efficiently.
-rwxr-xr-xTools/portbuild/scripts/dosetupnode10
1 files changed, 8 insertions, 2 deletions
diff --git a/Tools/portbuild/scripts/dosetupnode b/Tools/portbuild/scripts/dosetupnode
index dea397e48248..b45a623e2f1d 100755
--- a/Tools/portbuild/scripts/dosetupnode
+++ b/Tools/portbuild/scripts/dosetupnode
@@ -5,7 +5,12 @@ pb=/var/portbuild
arch=$1
branch=$2
node=$3
-shift
+shift 3
+
+norsync=0
+if [ "$1" = "-norsync" ]; then
+ norsync=1
+fi
. ${pb}/${arch}/portbuild.conf
@@ -25,7 +30,7 @@ if [ ! -z "${sudo_cmd}" ]; then
ssh -n ${client_user}@${node} ${sudo_cmd} "chown -R ${client_user} /var/portbuild/"
fi
-if [ "${disconnected}" = 1 ]; then
+if [ "${disconnected}" = 1 -a "${norsync}" = 0 ]; then
rsync ${rsync_gzip} -r -l -p --delete ${pb}/scripts ${client_user}@${node}:${pb}/
rsync ${rsync_gzip} -r -l -p --delete ${pb}/${arch}/portbuild* ${client_user}@${node}:${pb}/${arch}
rsync ${rsync_gzip} -r -l -p --delete ${pb}/${arch}/${branch}/ports ${client_user}@${node}:${pb}/${arch}/${branch}
@@ -34,4 +39,5 @@ if [ "${disconnected}" = 1 ]; then
rsync ${rsync_gzip} -r -l -p --delete ${pb}/${arch}/${branch}/tarballs/bindist* ${client_user}@${node}:${pb}/${arch}/${branch}/tarballs
fi
+lockf ${pb}/${arch}/queue/.lock ${pb}/scripts/pollmachine ${arch} ${node} -queue
echo "setting up of $node ended at $(date)"