Skip to content

MDBF-1226: Make duplicate push builds yield to PR builds#979

Merged
RazvanLiviuVarzaru merged 2 commits into
MariaDB:devfrom
RazvanLiviuVarzaru:fix/push-yields-to-pr-duplicate
Jun 25, 2026
Merged

MDBF-1226: Make duplicate push builds yield to PR builds#979
RazvanLiviuVarzaru merged 2 commits into
MariaDB:devfrom
RazvanLiviuVarzaru:fix/push-yields-to-pr-duplicate

Conversation

@RazvanLiviuVarzaru

@RazvanLiviuVarzaru RazvanLiviuVarzaru commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This is a fix for MDBF-1202 :: while working just fine for most of the time, there's a corner case where the PR build request sits in the queue for the whole duration of the push event build so it can no longer cancel its sibling.

In a GitHub double-event, Buildbot can queue the push and pull_request tarball-docker requests together, but the push build may get a worker first and complete while the corresponding PR request is still waiting in the queue. By the time the PR build finally runs, it is too late to prevent the duplicate tarball work and any downstream triggers that already happened.

The reverse can happen too: the PR build may finish before the push build gets a worker. To cover that without walking buildrequest history, the push side first checks incomplete same-builder requests, then falls back to only the 10 most recent completed same-builder requests.

Flip the direction so the push side yields when it sees the matching PR request. That makes the first running duplicate decide whether it should continue, instead of depending on the PR side to arrive soon enough after the fact.

The branch guard keeps this limited to disposable normal push branches: refs/* are ignored and branches covered by SAVED_PACKAGE_BRANCHES are not allowed to self-cancel.

@RazvanLiviuVarzaru RazvanLiviuVarzaru force-pushed the fix/push-yields-to-pr-duplicate branch from 66e4348 to 2209044 Compare June 23, 2026 13:30
@RazvanLiviuVarzaru RazvanLiviuVarzaru changed the title MDBF-1202: Make duplicate push builds yield to PR builds MDBF-1202 fix up: Make duplicate push builds yield to PR builds Jun 23, 2026
@RazvanLiviuVarzaru RazvanLiviuVarzaru force-pushed the fix/push-yields-to-pr-duplicate branch from 2209044 to 97f6ca2 Compare June 23, 2026 13:32
In a GitHub double-event, Buildbot can queue the push and pull_request tarball-docker requests together, but the push build may get a worker first and complete while the corresponding PR request is still waiting in the queue. By the time the PR build finally runs, it is too late to prevent the duplicate tarball work and any downstream triggers that already happened.

The reverse can happen too: the PR build may finish before the push build gets a worker. To cover that without walking buildrequest history, the push side first checks incomplete same-builder requests, then falls back to only the 10 most recent completed same-builder requests.

Flip the direction so the push side yields when it sees the matching PR request. That makes the first running duplicate decide whether it should continue, instead of depending on the PR side to arrive soon enough after the fact.

The branch guard keeps this limited to disposable normal push branches: refs/* are ignored and branches covered by SAVED_PACKAGE_BRANCHES are not allowed to self-cancel.
@RazvanLiviuVarzaru RazvanLiviuVarzaru force-pushed the fix/push-yields-to-pr-duplicate branch from 97f6ca2 to d757205 Compare June 23, 2026 13:59
@RazvanLiviuVarzaru RazvanLiviuVarzaru changed the title MDBF-1202 fix up: Make duplicate push builds yield to PR builds MDBF-1226: Make duplicate push builds yield to PR builds Jun 25, 2026
@RazvanLiviuVarzaru RazvanLiviuVarzaru merged commit a96fcbf into MariaDB:dev Jun 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants