Project

Profile

Help

Issue #4264

500 IntegrityErrors due to race conditions

Added by daviddavis over 1 year ago. Updated about 1 year ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
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 over 1 year ago

  • Triaged changed from No to Yes

#2 Updated by bmbouter about 1 year ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF