MDBF-1225: Use claimed time for obsolete request cutoff#978
Merged
RazvanLiviuVarzaru merged 1 commit intoJun 25, 2026
Merged
Conversation
fauust
approved these changes
Jun 23, 2026
CancelOlderSameBranchRequests previously used the current buildset submitted_at as the cutoff for deciding which matching buildrequests were older. That is too early for tarball-docker: the newer tarball buildrequest may be queued while the previous tarball is still finishing and triggering downstream buildsets. Those downstream requests can then be submitted after the newer tarball request was queued, so only the subset submitted before that queued timestamp gets cancelled.
Use the current buildrequest claimed_at instead. By the time tarball-docker is running this step, Buildbot has already claimed the buildrequest to create/run the build, so claimed_at is expected to be present and marks the point where the newer tarball actually started being handled by a master.
For candidates, use br.get('submitted_at') from the buildrequest data returned by the /buildrequests query. Buildbot exposes buildrequest claimed_at and submitted_at as the same DateTime type, while buildset submitted_at is converted to an integer epoch value by the buildsets data API. Comparing buildrequest timestamps avoids extra type conversion and avoids mixing the two API representations. The buildset lookup remains only for sourcestamps used by the branch/repository/codebase/revision match.
050be9f to
5830d50
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a fix for: MDBF-1200 :: resolving a timing issue where not all older br's were cancelled.
CancelOlderSameBranchRequestspreviously used the current buildsetsubmitted_atas the cutoff for deciding which matching buildrequests were older. That is too early fortarball-docker: the newer tarball buildrequest may be queued while the previous tarball is still finishing and triggering downstream buildsets. Those downstream requests can then be submitted after the newer tarball request was queued, so only the subset submitted before that queued timestamp gets cancelled.Use the current buildrequest
claimed_atinstead. By the timetarball-dockeris running this step, Buildbot has already claimed the buildrequest to create/run the build, soclaimed_atis expected to be present and marks the point where the newer tarball actually started being handled by a master.For candidates, use
br.get('submitted_at')from the buildrequest data returned by the/buildrequestsquery. Buildbot exposes buildrequestclaimed_atandsubmitted_atas the sameDateTimetype, while buildsetsubmitted_atis converted to an integer epoch value by the buildsets data API. Comparing buildrequest timestamps avoids extra type conversion and avoids mixing the two API representations. The buildset lookup remains only for sourcestamps used by the branch/repository/codebase/revision match.