Skip to content

Conversation

@majamassarini
Copy link
Member

It fixes the race condition triggered by the unit test created in the previous commit.

RELEASE NOTES BEGIN

We have fixed a race condition that prevented copr builds to being reported as complete.

RELEASE NOTES END

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively addresses a race condition when creating Copr build groups, particularly in concurrent scenarios with monorepos. The use of an atomic database update is a solid approach to prevent this issue. The changes are well-supported by a comprehensive, albeit complex, new test case that simulates the race condition. The updates to other files are mostly mechanical adaptations to the new method signature. I have one suggestion regarding code duplication that could improve maintainability.

Copy link
Member

@nforro nforro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording revolves around threads, but in deployment it could be different workers causing the issue. I would probably use the term worker which can stand for both a worker container and a worker thread.

@centosinfra-prod-github-app
Copy link
Contributor

@centosinfra-prod-github-app
Copy link
Contributor

majamassarini and others added 2 commits February 10, 2026 12:40
If you run the test, it will fail with a race condition.
If you comment out the barrier.wait(),
and add a sleep of 2 seconds before each thread starts,
the test will "pass", or better, it will fail,
differently, because the threads didn't run at the same time.
It fixes the race condition triggered by the unit test created in the previous commit.

Co-authored-by: Nikola Forró <[email protected]>
@majamassarini majamassarini force-pushed the fix-copr-builds-race-condition branch from 613737a to 7e99633 Compare February 10, 2026 11:41
@majamassarini
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively addresses a race condition in Copr build group creation. The new implementation in CoprBuildGroupModel.create correctly uses atomic database operations to prevent concurrent workers from causing issues, which is a solid approach. The addition of a comprehensive, multi-threaded test case to reproduce and verify the fix is excellent and greatly increases confidence in the change. I have a couple of suggestions to improve the implementation of the new test case for better maintainability and robustness, but the core logic of the fix is sound.

@majamassarini majamassarini added the mergeit Merge via Zuul label Feb 10, 2026
@centosinfra-prod-github-app
Copy link
Contributor

@centosinfra-prod-github-app
Copy link
Contributor

@centosinfra-prod-github-app centosinfra-prod-github-app bot merged commit 1fc733d into packit:main Feb 10, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Packit pull requests Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mergeit Merge via Zuul

Projects

Development

Successfully merging this pull request may close these issues.

2 participants