1
Fork 0

Merge pull request #7157 from Eideticom/martin/br_fetch_sort

process/buildrequestdistributor: sort unclaimed br cache by requestid
This commit is contained in:
Povilas Kanapickas 2023-11-07 06:03:47 +02:00 committed by GitHub
commit 09a54abffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

View File

@ -200,6 +200,7 @@ buildreq
buildrequest
buildrequestcompletions
buildrequestdistributor
buildrequestid
buildrequestresults
buildrequests
buildrequestsconnectorcomponent

View File

@ -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

View File

@ -106,6 +106,7 @@ Buildmaster
buildmasters
buildnumber
buildrequest
buildrequestid
buildrequests
buildset
Buildset

View File

@ -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.