Merge pull request #7157 from Eideticom/martin/br_fetch_sort
process/buildrequestdistributor: sort unclaimed br cache by requestid
This commit is contained in:
commit
09a54abffc
|
@ -200,6 +200,7 @@ buildreq
|
|||
buildrequest
|
||||
buildrequestcompletions
|
||||
buildrequestdistributor
|
||||
buildrequestid
|
||||
buildrequestresults
|
||||
buildrequests
|
||||
buildrequestsconnectorcomponent
|
||||
|
|
|
@ -87,8 +87,8 @@ class BuildChooserBase:
|
|||
[resultspec.Filter('claimed',
|
||||
'eq',
|
||||
[False])])
|
||||
# sort by submitted_at, so the first is the oldest
|
||||
brdicts.sort(key=lambda brd: brd['submitted_at'])
|
||||
# sort by buildrequestid, so the first is the oldest
|
||||
brdicts.sort(key=lambda brd: brd['buildrequestid'])
|
||||
self.unclaimedBrdicts = brdicts
|
||||
return self.unclaimedBrdicts
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ Buildmaster
|
|||
buildmasters
|
||||
buildnumber
|
||||
buildrequest
|
||||
buildrequestid
|
||||
buildrequests
|
||||
buildset
|
||||
Buildset
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Buildrequests are now selected by priority and then by buildrequestid (previously, we used the age as the secondary sort parameter). This preserves the property of choosing the oldest buildrequest, but makes it predictable which buildrequest will be selected, as there might be multiple buildrequests with the same age.
|
Loading…
Reference in New Issue