Skip to content

Commit f422971

Browse files
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. 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.
1 parent d98e784 commit f422971

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

locks.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
from buildbot.plugins import util
66

77
# Local
8-
from constants import BUILDERS_INSTALL, BUILDERS_UPGRADE, GITHUB_STATUS_BUILDERS
8+
from constants import (
9+
BUILDERS_INSTALL,
10+
BUILDERS_UPGRADE,
11+
GITHUB_STATUS_BUILDERS,
12+
RELEASE_BRANCHES,
13+
)
14+
from utils import fnmatch_any
915

1016
LOCKS: dict[str, util.MasterLock] = {}
1117
# worker_locks.yaml currently is in the same folder as locks.py.
@@ -26,6 +32,7 @@
2632
def getLocks(props):
2733
worker_name = props.getProperty("workername", default=None)
2834
builder_name = props.getProperty("buildername", default=None)
35+
branch = props.getProperty("branch", default=None)
2936
assert worker_name is not None
3037
assert builder_name is not None
3138

@@ -36,6 +43,14 @@ def getLocks(props):
3643
):
3744
return []
3845

46+
# Autobake (packages) builders on release branches disobey locks
47+
if (
48+
branch
49+
and "autobake" in builder_name.lower()
50+
and fnmatch_any(branch, RELEASE_BRANCHES)
51+
):
52+
return []
53+
3954
for worker_base_name in LOCKS:
4055
if worker_name.startswith(worker_base_name):
4156
return [LOCKS[worker_base_name].access("counting")]

0 commit comments

Comments
 (0)