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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « masters/master.client.v8/master.cfg ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of Buildbot. Buildbot is free software: you can 1 # This file is part of Buildbot. Buildbot is free software: you can
2 # redistribute it and/or modify it under the terms of the GNU General Public 2 # redistribute it and/or modify it under the terms of the GNU General Public
3 # License as published by the Free Software Foundation, version 2. 3 # License as published by the Free Software Foundation, version 2.
4 # 4 #
5 # This program is distributed in the hope that it will be useful, but WITHOUT 5 # This program is distributed in the hope that it will be useful, but WITHOUT
6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
8 # details. 8 # details.
9 # 9 #
10 # You should have received a copy of the GNU General Public License along with 10 # You should have received a copy of the GNU General Public License along with
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 [ self._brdictToBuildRequest(brdict) 849 [ self._brdictToBuildRequest(brdict)
850 for brdict in unclaimed_requests ])) 850 for brdict in unclaimed_requests ]))
851 yield wfd 851 yield wfd
852 unclaimed_request_objects = wfd.getResult() 852 unclaimed_request_objects = wfd.getResult()
853 breq_object = unclaimed_request_objects.pop( 853 breq_object = unclaimed_request_objects.pop(
854 unclaimed_requests.index(breq)) 854 unclaimed_requests.index(breq))
855 855
856 # gather the mergeable requests 856 # gather the mergeable requests
857 merged_request_objects = [breq_object] 857 merged_request_objects = [breq_object]
858 for other_breq_object in unclaimed_request_objects: 858 for other_breq_object in unclaimed_request_objects:
859 wfd = defer.waitForDeferred( 859 if getattr(mergeRequests_fn, 'with_length', False):
860 defer.maybeDeferred(lambda : 860 # If supported, we also pass the number of unclaimed and
861 mergeRequests_fn(breq_object, other_breq_object))) 861 # the number of already merged builds. The first might not
862 # reflect the exact number that could be merged (this
863 # depends on the canBeMergedWith algorithm), but it can help
864 # indicating how loaded this builder is.
865 to_defer = lambda : mergeRequests_fn(
866 breq_object,
867 other_breq_object,
868 len(unclaimed_request_objects),
869 len(merged_request_objects),
870 )
871 else:
872 to_defer = lambda : mergeRequests_fn(
873 breq_object,
874 other_breq_object,
875 )
876 wfd = defer.waitForDeferred(defer.maybeDeferred(to_defer))
862 yield wfd 877 yield wfd
863 if wfd.getResult(): 878 if wfd.getResult():
864 merged_request_objects.append(other_breq_object) 879 merged_request_objects.append(other_breq_object)
865 880
866 # convert them back to brdicts and return 881 # convert them back to brdicts and return
867 merged_requests = [ br.brdict for br in merged_request_objects ] 882 merged_requests = [ br.brdict for br in merged_request_objects ]
868 yield merged_requests 883 yield merged_requests
869 884
870 def _brdictToBuildRequest(self, brdict): 885 def _brdictToBuildRequest(self, brdict):
871 """ 886 """
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 d = defer.DeferredList(dl) 994 d = defer.DeferredList(dl)
980 d.addCallback(self._gatherPingResults) 995 d.addCallback(self._gatherPingResults)
981 return d 996 return d
982 997
983 def _gatherPingResults(self, res): 998 def _gatherPingResults(self, res):
984 for ignored,success in res: 999 for ignored,success in res:
985 if not success: 1000 if not success:
986 return False 1001 return False
987 return True 1002 return True
988 1003
OLDNEW
« 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