Actions
Issue #4264
closed500 IntegrityErrors due to race conditions
Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:
Description
This came up in the discussion on https://github.com/pulp/pulp_file/pull/142 where I added some uniqueness validation. It exists throughout our codebase.
Consider the case that you have two users creating a repo with the same name "foo" at virtually the same time. We have a uniqueness constraint on repository name. However, suppose these parallel requests are processed in this order:
1. User 1's request is validated
2. User 2's request is validated
3. User 1's repo is saved to the database
4. Pulp tries to save user 2's repo to the database
At step 4, an IntegrityError will be raised and a 500 will be returned to the user. It looks like this issue was opened at one point against DRF:
Actions