Skip to content

Conversation

@Jlu18
Copy link
Member

@Jlu18 Jlu18 commented Mar 26, 2021

When user logged in, it try to retrieve the list of user's collection and scene asynchronously. And during the process, both call verifyGoogleToken function to see if the user exists in the database, and create new one if it doesn't. Since two asynchronous calls are looking for the same id, the race condition happens and both not finding the id, and creating two exact id in database.

By adding mutex lock, it ensures only one process is accessing at a time.

@Jlu18 Jlu18 requested a review from kdvalin March 26, 2021 17:23
@kdvalin kdvalin merged commit 9d1fe40 into engaging-computing:dev Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants