[Piuparts-commits] [piuparts] 06/09: reschedule_oldest_logs: reschedule pass/ logs only if section was recently idle
Holger Levsen
holger at moszumanska.debian.org
Tue Feb 10 12:18:07 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit b7a6c321ae61efe48f7577d62fc0005041a64be0
Author: Andreas Beckmann <anbe at debian.org>
Date: Tue Feb 10 11:29:07 2015 +0100
reschedule_oldest_logs: reschedule pass/ logs only if section was recently idle
there is no point in recycling if we can't keep up with regular processing
Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
debian/changelog | 1 +
master-bin/reschedule_oldest_logs.in | 18 +++++++++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 9907a24..ee0de7b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -27,6 +27,7 @@ piuparts (0.63) UNRELEASED; urgency=medium
removed source packages or retired maintainers) after 30 days.
* reschedule_oldest_logs:
- Fix gradual oldest-first recycling if nearly all logs are candidates.
+ - Recycle/expire pass/ logs only if the section is (recycle-)idle.
* scripts-sysvinit/pre_distupgrade_zz_sysvinit: New custom script for doing
wheezy->jessie upgrade tests while keeping sysvinit as init if possible.
* scripts/pre_remove_40_find_unowned_lib_links: Ignore /lib/ld-lsb.so.[123]
diff --git a/master-bin/reschedule_oldest_logs.in b/master-bin/reschedule_oldest_logs.in
index 6cfb1b7..cd09dea 100755
--- a/master-bin/reschedule_oldest_logs.in
+++ b/master-bin/reschedule_oldest_logs.in
@@ -40,6 +40,19 @@ get_config_value FAIL_COUNT global reschedule-fail-count 25
get_config_value AUTO_RESCHEDULE global auto-reschedule yes
+RECENT=$(mktemp)
+touch -d "2 days ago" "$RECENT"
+is_recent()
+{
+ local stamp
+ stamp="$1"
+ if [ -f "$stamp" ] && [ "$stamp" -nt "$RECENT" ]; then
+ return 0
+ fi
+ return 1
+}
+
+
list_logs()
{
__AGE="$1"
@@ -109,7 +122,9 @@ for SECTION in $SECTIONS ; do
test -f "recycle/${log#*/}" && echo "$log"
done > $EXPIRED
>$UNSORTED
- list_logs $_AGE $_COUNT pass fail affected >> $UNSORTED
+ if is_recent idle.stamp ; then
+ list_logs $_AGE $_COUNT pass fail affected >> $UNSORTED
+ fi
list_logs $_FAIL_AGE $_FAIL_COUNT fail affected >> $UNSORTED
for log in $(sort -u $UNSORTED) ; do
# skip if already scheduled
@@ -147,6 +162,7 @@ for SECTION in $SECTIONS ; do
fi
cd $OLDPWD
done
+rm $RECENT
rm $LOGS
rm $OBSOLETE
rm $EXPIRED
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list