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

Fix savefile import DbConcurrencyException #102

Merged
merged 4 commits into from
Jan 21, 2023

Conversation

SapiensAnatis
Copy link
Owner

If a save import took a long time, the client would re-call /tool/auth again before receiving a response.. This would trigger another save import while the existing one was running and lead to a DbConcurrencyException.

This PR:

  • Adds a locking mechanism by setting a string derived from the account ID in Redis
  • If a subsequent request is received, and a matching ID string is in Redis, no import is attempted and the Task is simply to wait until this key disappears
  • Also converts BaasRequestHelper to use Redis to cache the jwks, thus making the main application truly stateless again.

@SapiensAnatis SapiensAnatis merged commit d37209b into develop Jan 21, 2023
@SapiensAnatis SapiensAnatis deleted the sapiensanatis/db-concurrency branch January 21, 2023 22:05
SapiensAnatis added a commit that referenced this pull request Jun 30, 2024
If a save import took a long time, the client would re-call `/tool/auth`
again before receiving a response.. This would trigger another save
import while the existing one was running and lead to a
DbConcurrencyException.

This PR:

- Adds a locking mechanism by setting a string derived from the account
ID in Redis
- If a subsequent request is received, and a matching ID string is in
Redis, no import is attempted and the Task is simply to wait until this
key disappears
- Also converts `BaasRequestHelper` to use Redis to cache the jwks, thus
making the main application truly stateless again.
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.

None yet

1 participant