Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 500 error on parallel same-object creates #4245

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

gerrod3
Copy link
Contributor

@gerrod3 gerrod3 commented Aug 2, 2023

fixes: #4183

Not sure how to write a test for this. I manually tested this with

http :5001/pulp/api/v3/repositories/file/file/ name=foo & http :5001/pulp/api/v3/repositories/file/file/ name=foo

Roughly 1 in 3 attempts will fail with a 500 error, this fixes the race condition and will give a nice 400 error.

@jlsherrill Interestingly you found this bug when creating domains, but it actually affects all immediate-creation objects in Pulp. 馃槷

Copy link
Member

@mdellweg mdellweg left a comment

Choose a reason for hiding this comment

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

Is this maybe interesting for drf too?

@jlsherrill
Copy link
Contributor

Thanks @gerrod3 !

@mdellweg mdellweg merged commit bc4e4f4 into pulp:main Aug 3, 2023
14 checks passed
@gerrod3 gerrod3 deleted the parallel-same-creates branch August 7, 2023 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflicting Domain creation at the same time results in an ISE (500)
4 participants