Project

Profile

Help

Issue #4264

500 IntegrityErrors due to race conditions

Added by daviddavis 10 months ago. Updated 6 months ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

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:

https://github.com/encode/django-rest-framework/issues/3876

History

#1 Updated by CodeHeeler 10 months ago

  • Triaged changed from No to Yes

#2 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF