Skip to content

Commit

Permalink
Merge pull request #7157 from Eideticom/martin/br_fetch_sort
Browse files Browse the repository at this point in the history
process/buildrequestdistributor: sort unclaimed br cache by requestid
  • Loading branch information
p12tic committed Nov 7, 2023
2 parents 114c8cc + 9b84a03 commit 09a54ab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions common/code_spelling_ignore_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ buildreq
buildrequest
buildrequestcompletions
buildrequestdistributor
buildrequestid
buildrequestresults
buildrequests
buildrequestsconnectorcomponent
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/process/buildrequestdistributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def _fetchUnclaimedBrdicts(self):
[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

Expand Down
1 change: 1 addition & 0 deletions master/docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Buildmaster
buildmasters
buildnumber
buildrequest
buildrequestid
buildrequests
buildset
Buildset
Expand Down
1 change: 1 addition & 0 deletions newsfragments/buildrequest-sort.bugfix
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 09a54ab

Please sign in to comment.