Skip to content

Commit d8cda5c

Browse files
encukouzware
andauthored
Use max_builds instead of a lock (#734)
Co-authored-by: Zachary Ware <zach@python.org>
1 parent b8f9893 commit d8cda5c

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

master/custom/workers.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(
3030
tags=None,
3131
branches=None,
3232
not_branches=None,
33-
parallel_builders=None,
33+
parallel_builders=1,
3434
parallel_tests=None,
3535
timeout_factor=1,
3636
exclude_test_resources=None,
@@ -40,7 +40,6 @@ def __init__(
4040
self.tags = tags or set()
4141
self.branches = branches
4242
self.not_branches = not_branches
43-
self.parallel_builders = parallel_builders
4443
self.parallel_tests = parallel_tests
4544
self.timeout_factor = timeout_factor
4645
self.exclude_test_resources = exclude_test_resources or []
@@ -55,9 +54,13 @@ def __init__(
5554
if settings.use_local_worker:
5655
self.bb_worker = _worker.LocalWorker(name)
5756
else:
58-
self.bb_worker = _worker.Worker(name, str(pw),
59-
notify_on_missing=emails,
60-
keepalive_interval=KEEPALIVE)
57+
self.bb_worker = _worker.Worker(
58+
name,
59+
str(pw),
60+
notify_on_missing=emails,
61+
keepalive_interval=KEEPALIVE,
62+
max_builds=parallel_builders,
63+
)
6164

6265
# Some of Itamar's workers are reprovisioned every Wednesday at 9am PT.
6366
# Builds scheduled between 8am - 10am PT on Wednesdays will be delayed to

master/master.cfg

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,6 @@ c["workers"] = [w.bb_worker for w in WORKERS]
133133
c["builders"] = []
134134
c["schedulers"] = []
135135

136-
# The following with the worker owners' agreement
137-
cpulock = locks.WorkerLock(
138-
"cpu",
139-
maxCountForWorker={
140-
w.name: w.parallel_builders for w in WORKERS if w.parallel_builders
141-
},
142-
)
143-
144136

145137
def is_important_file(filename):
146138
unimportant_prefixes = (
@@ -273,7 +265,6 @@ for branch in BRANCHES:
273265
builddir=f"{branch.builddir_name}.{worker.name}{f.buildersuffix}",
274266
factory=f,
275267
tags=tags,
276-
locks=[cpulock.access("counting")],
277268
)
278269

279270
if worker.downtime:

0 commit comments

Comments
 (0)