From 5d1d1fb1ae445a073275925e943603f9a942f55d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 17 Jun 2023 21:46:56 +0200 Subject: bin/get-assignment: change ordering * only consider packages with highest priority * should make "forced-package-builds-*" obsolete --- bin/get-assignment | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'bin') diff --git a/bin/get-assignment b/bin/get-assignment index 25281e6..37b430f 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -201,16 +201,15 @@ while [ -s "${work_dir}/forced-package-builds.${slave}" ]; do fi done -# a package with [all dependencies met (or unsuccessfully built) or which is part of a loop] -# and which is currently not being built, ordered by: +# a package with [all dependencies met (or unsuccessfully built) or which is part of a loop], +# which is currently not being built and which has the highest priority, ordered by: # 1: we requested it # 2: tool chain priority -# 3: its priority -# 4: was built the least times -# 5: architecture matches (or the slave is from the majority architecture) -# 6: is part of a loop -# 7: has the oldes package source -# 8: build_assignment id +# 3: was built the least times +# 4: architecture matches (or the slave is from the majority architecture) +# 5: is part of a loop +# 6: has the oldes package source +# 7: build_assignment id next_building=$( # shellcheck disable=SC2016 { @@ -222,6 +221,11 @@ next_building=$( printf ');\n' done + printf 'SET @`max_priority`=(' + printf 'SELECT MAX(`build_assignments`.`priority`)' + printf ' FROM `build_assignments`' + printf ');\n' + printf 'INSERT IGNORE INTO `considered_build_assignments` (`id`)' printf ' SELECT `build_assignments`.`id`' printf ' FROM `build_assignments`' @@ -243,7 +247,8 @@ next_building=$( printf ')' printf ' LEFT' mysql_join_package_sources_toolchain_order - printf ' WHERE (' + printf ' WHERE `build_assignments`.`priority`=@`max_priority`' + printf ' AND (' printf '`build_assignments`.`is_blocked` IS NULL' if [ -n "${requested}" ]; then printf ' OR' @@ -540,7 +545,6 @@ next_building=$( # 1: in toolchain, should be built later # 2: not in toolchain printf 'IFNULL(`toolchain_query`.`priority`,2),' - printf '`build_assignments`.`priority` DESC,' printf 'IFNULL(`latest_failed_builds`.`count`,0),' printf 'IF(' printf '`architectures`.`id`=%s' \ -- cgit v1.2.3-54-g00ecf