HomePhabricator

Catch race conditions when multiple processes try to create the profile for a…

Description

Catch race conditions when multiple processes try to create the profile for a user

Summary:
When multiple processes try to get() the profile of a user that doesn't already have one in the database
a reace condition might occure. Because a OneToOne Field is used an IntegrityError will be raised.
In case this error is raised, we can be sure someone else created the profile and fetch it again.

Test Plan: None. Testing race conditions is hard.

Reviewers: CLOVIS, WyldBot

Reviewed By: WyldBot

Differential Revision: https://phabricator.wildfyre.net/D245

Details

Provenance
Info-ScreenAuthored on Apr 22 2019, 6:10 PM
Reviewer
WyldBot
Differential Revision
D245: Catch race conditions when multiple processes try to create the profile for a user
Parents
rAPI1ebf72a0269c: Fix flag admin url resolving
Branches
Unknown
Tags
Unknown