-
Notifications
You must be signed in to change notification settings - Fork 859
1173-MCV Fix: Use Redis to keep recorded "sentence_id"s per user #4944
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
Merged
moz-bozden
merged 3 commits into
main
from
1173-mcv-fix-use-be-redis-to-keep-recorded-sentence-ids-per-user
Jun 19, 2025
Merged
1173-MCV Fix: Use Redis to keep recorded "sentence_id"s per user #4944
moz-bozden
merged 3 commits into
main
from
1173-mcv-fix-use-be-redis-to-keep-recorded-sentence-ids-per-user
Jun 19, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size Change: +14 B (0%) Total Size: 6.87 MB ℹ️ View Unchanged
|
moz-dfeller
requested changes
Jun 19, 2025
moz-dfeller
approved these changes
Jun 19, 2025
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a race condition we debugged.
Explanation
Many new and/or low-resource languages must have seen this: You remember that you already recorded a sentence, you record it again, but when you submit it a pop-up comes out saying it could not be saved with two options: Retry - Cancel.
Even if you retry, you cannot pass it, the only way is to press cancel.
We found out the code is correct, but there is a race condition: The database (DB) updates are slower than selects. Here is what was happening:
In this fix, we keep the sentence_id's which got recorded - for each user in memory for an hour and filter out from the results, which effectively overcomes the race condition caused by slow DB UPDATE process.
Related issues to be closed
TBA