[BUG]: InMemoryBlockingCache is not thread-safe #5354
Labels
bug
End user-perceivable behaviors which are not desirable.
Impact: Low
Low perceived user impact (e.g. edge cases).
Work: Medium
The means to find the solution is clear, but it isn't at good-first-issue level yet.
Milestone
Describe the bug
InMemoryBlockingCache needs to process CRUD operations sequentially. To do so, it launches coroutines in a scope with a single-threaded dispatcher. However, using a single-thread does not guarantee sequentiality nor atomicity when combined with coroutines:
Potential solutions include:
Steps To Reproduce
No steps, errors can happen randomly. Might be related to #5064.
Expected Behavior
The class should be thread-safe
Screenshots/Videos
No response
What device/emulator are you using?
No response
Which Android version is your device/emulator running?
No response
Which version of the Oppia Android app are you using?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: