Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle race conditions at various places using mutex #327

Closed
ayusht2810 opened this issue Sep 25, 2023 · 0 comments · Fixed by #344
Closed

Handle race conditions at various places using mutex #327

ayusht2810 opened this issue Sep 25, 2023 · 0 comments · Fixed by #344
Assignees

Comments

@ayusht2810
Copy link
Contributor

ayusht2810 commented Sep 25, 2023

Handle race conditions at various places:

  • Create/update activities from Mattermost to Teams: Let's say we add a reaction on Mattermost, and in the plugin hook we make an API call to add the corresponding reaction on MS Teams. Before storing the lastUpdateAt time in the database, we receive an update event from MS Teams, and we check for the lastUpdateAt time in the database for the corresponding post which might not be updated at that moment due to which we again make changes on Mattermost. This also causes an issue of reactions not syncing from MS Teams to Mattermost.
  • Creating/renewing of subscriptions
  • Creating synthetic users during the user sync job or via the function getOrCreateSyntheticUser https://github.com/mattermost/mattermost-plugin-msteams-sync/blob/dfab068dd25eb243fc0a7cadf748d03a4c607c0f/server/handlers/getters.go#L91

Issue 327_ Handle race conditions at various places using mutex.pdf

@ayusht2810 ayusht2810 changed the title Handle race conditions at various places Handle race conditions at various places using mutex Sep 26, 2023
lieut-data pushed a commit that referenced this issue Jan 11, 2024
* Removing transaction parameter from SaveChannelSubscription store method

* Removing the transactions (that reintroduces the the bugs #327 and #330

* Removing more stuff from the transactions

* Using cluster mutexes to serialize per-post certain actions

* Adding error handling to mutex creation

* Fixing timer layer generation

* Fixing CI

* Fixing CI

* Fixing CI

* Fixing tests

* Fixing tests

* Fixing tests

* Fixing tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment