Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1241)

Unified Diff: third_party/buildbot_8_4p1/buildbot/process/builder.py

Issue 2415703004: Enable merging buildbot builds dependent on queue length (Closed)
Patch Set: Review Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « masters/master.client.v8/master.cfg ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/buildbot_8_4p1/buildbot/process/builder.py
diff --git a/third_party/buildbot_8_4p1/buildbot/process/builder.py b/third_party/buildbot_8_4p1/buildbot/process/builder.py
index e92e2d1a34fa1e47532343f21a4beca500dd0080..bc989284c0c1b7ea9bcb577bc7ee1687130063ac 100644
--- a/third_party/buildbot_8_4p1/buildbot/process/builder.py
+++ b/third_party/buildbot_8_4p1/buildbot/process/builder.py
@@ -856,9 +856,24 @@ class Builder(pb.Referenceable, service.MultiService):
# gather the mergeable requests
merged_request_objects = [breq_object]
for other_breq_object in unclaimed_request_objects:
- wfd = defer.waitForDeferred(
- defer.maybeDeferred(lambda :
- mergeRequests_fn(breq_object, other_breq_object)))
+ if getattr(mergeRequests_fn, 'with_length', False):
+ # If supported, we also pass the number of unclaimed and
+ # the number of already merged builds. The first might not
+ # reflect the exact number that could be merged (this
+ # depends on the canBeMergedWith algorithm), but it can help
+ # indicating how loaded this builder is.
+ to_defer = lambda : mergeRequests_fn(
+ breq_object,
+ other_breq_object,
+ len(unclaimed_request_objects),
+ len(merged_request_objects),
+ )
+ else:
+ to_defer = lambda : mergeRequests_fn(
+ breq_object,
+ other_breq_object,
+ )
+ wfd = defer.waitForDeferred(defer.maybeDeferred(to_defer))
yield wfd
if wfd.getResult():
merged_request_objects.append(other_breq_object)
« no previous file with comments | « masters/master.client.v8/master.cfg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698