[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible (alpine|archlinux): scheduler: always begin the schroot session, ...

Mattia Rizzolo gitlab at salsa.debian.org
Sun Aug 23 22:01:04 BST 2020



Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net


Commits:
c0736467 by Mattia Rizzolo at 2020-08-23T23:00:48+02:00
reproducible (alpine|archlinux): scheduler: always begin the schroot session, and leave the cleanup to the trap, to avoid some possible cases of schroot sessions leaking

spotted a leak while keeping an eye on the current sessions

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


2 changed files:

- bin/reproducible_alpine_scheduler.sh
- bin/reproducible_archlinux_scheduler.sh


Changes:

=====================================
bin/reproducible_alpine_scheduler.sh
=====================================
@@ -28,8 +28,6 @@ update_alpine_repositories() {
 	echo "$(date -u ) - $TOTAL alpine packages were previously known to alpine."
 	query_db "SELECT suite, name, version FROM sources WHERE distribution=$DISTROID AND architecture='$ARCH';" > $KNOWN
 	echo "$(date -u ) - $(cat $KNOWN | wc -l) alpine packages are known in our database."
-	# init session
-	schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-alpine
 	echo "$(date -u ) - updating our knowledge of alpine repositories (by running git pull)."
 	schroot --run-session -c $SESSION --directory /var/lib/jenkins/aports -- git pull
 
@@ -152,7 +150,6 @@ update_alpine_repositories() {
 		updated=$(grep -c ^$REPO $UPDATED || true)
 		echo "$(date -u ) - scheduled $new/$updated packages in repository '$REPO'."
 	done
-	schroot --end-session -c $SESSION
 
 	#
 	# schedule up to $MAX packages in DEPWAIT_ or 404_ states
@@ -286,8 +283,9 @@ update_alpine_repositories() {
 trap cleanup_all INT TERM EXIT
 ARCH="x86_64"
 SESSION="alpine-scheduler-$RANDOM"
+# init session
+schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-alpine
 DISTROID=$(query_db "SELECT id FROM distributions WHERE name = 'alpine'")
 update_alpine_repositories
-trap - INT TERM EXIT
 
 # vim: set sw=0 noet :


=====================================
bin/reproducible_archlinux_scheduler.sh
=====================================
@@ -27,8 +27,6 @@ update_archlinux_repositories() {
 	echo "$(date -u ) - $TOTAL Arch Linux packages were previously known to Arch Linux."
 	query_db "SELECT suite, name, version FROM sources WHERE distribution=$DISTROID AND architecture='$ARCH';" > $KNOWN
 	echo "$(date -u ) - $(cat $KNOWN | wc -l) Arch Linux packages are known in our database."
-	# init session
-	schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-archlinux
 	echo "$(date -u ) - updating pacman's knowledge of Arch Linux repositories (by running pacman -Syu --noconform')."
 	schroot --run-session -c $SESSION --directory /var/tmp -- sudo pacman -Syu --noconfirm
 
@@ -154,7 +152,6 @@ update_archlinux_repositories() {
 		updated=$(grep -c ^$REPO $UPDATED || true)
 		echo "$(date -u ) - scheduled $new/$updated packages in repository '$REPO'."
 	done
-	schroot --end-session -c $SESSION
 
 	#
 	# schedule up to $MAX packages in DEPWAIT_ or 404_ states
@@ -286,8 +283,9 @@ update_archlinux_repositories() {
 trap cleanup_all INT TERM EXIT
 ARCH="x86_64"
 SESSION="archlinux-scheduler-$RANDOM"
+# init session
+schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-archlinux
 DISTROID=$(query_db "SELECT id FROM distributions WHERE name = 'archlinux'")
 update_archlinux_repositories
-trap - INT TERM EXIT
 
 # vim: set sw=0 noet :



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/c0736467ab8a6e8bd04c1b09cb57c1ed62a2dbf8

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/c0736467ab8a6e8bd04c1b09cb57c1ed62a2dbf8
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20200823/e768a257/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list