From 5d4de7dbb9184749620cb05c9ea6584a9926f46a Mon Sep 17 00:00:00 2001 From: Razvan-Liviu Varzaru Date: Wed, 28 Jan 2026 17:47:18 +0200 Subject: [PATCH] Bypass locks for release packages builders on bb-* branches TLDR; Autobake builds on release branches can ignore Locks. This patch is an experiment for the next release (March-April). DO NOT MERGE BEFORE JANUARY RELEASE IS DONE. Long-Story: Although the bb-*-release release branches have priority when being selected from the queue, they are often blocked in the acquiring locks status, a mechanism meant to prevent overloading a host. As a result, in most cases we need to manually stop other builds, thus freeing the hosts and allowing a release build to start. This is not guaranteed, however, because Buildbot may select a completely different builder to start on that host, often a non-release build, which causes the release build of interest to remain stuck in the same status. This patch aims to remove this limitation by allowing builds that produce packages (autobake) to start on configured hosts regardless of the Locks value. The risk of this patch is obvious: there is a possibility of overloading the host and causing the build to fail. We can, however, try this approach and rollback during the next release if we discover that the failure rate caused by overloading the host exceeds the benefifs. I am also relying on the fact that autobake builders are not memory-intensive but mostly CPU-bound, with parallel execution occurring only during the build phase, not when the packages are created. --- locks.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/locks.py b/locks.py index 282466f5f..90ce7ec12 100644 --- a/locks.py +++ b/locks.py @@ -5,7 +5,13 @@ from buildbot.plugins import util # Local -from constants import BUILDERS_INSTALL, BUILDERS_UPGRADE, GITHUB_STATUS_BUILDERS +from constants import ( + BUILDERS_INSTALL, + BUILDERS_UPGRADE, + GITHUB_STATUS_BUILDERS, + RELEASE_BRANCHES, +) +from utils import fnmatch_any LOCKS: dict[str, util.MasterLock] = {} # worker_locks.yaml currently is in the same folder as locks.py. @@ -26,6 +32,7 @@ def getLocks(props): worker_name = props.getProperty("workername", default=None) builder_name = props.getProperty("buildername", default=None) + branch = props.getProperty("branch", default=None) assert worker_name is not None assert builder_name is not None @@ -36,6 +43,14 @@ def getLocks(props): ): return [] + # Autobake (packages) builders on release branches disobey locks + if ( + branch + and "autobake" in builder_name.lower() + and fnmatch_any(branch, RELEASE_BRANCHES) + ): + return [] + for worker_base_name in LOCKS: if worker_name.startswith(worker_base_name): return [LOCKS[worker_base_name].access("counting")]