Project

Profile

Help

Issue #4264

closed

500 IntegrityErrors due to race conditions

Added by daviddavis over 5 years ago. Updated over 3 years ago.

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:

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

Actions #1

Updated by CodeHeeler over 5 years ago

  • Triaged changed from No to Yes
Actions #2

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)
Actions #3

Updated by daviddavis over 3 years ago

  • Status changed from NEW to CLOSED - WONTFIX

Also available in: Atom PDF