Project

Profile

Help

Issue #4264

500 IntegrityErrors due to race conditions

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

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

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF