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 #5354: Replaced single-threaded scope with Actor #5608

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

manas-yu
Copy link
Collaborator

@manas-yu manas-yu commented Dec 19, 2024

Explanation

Fix #5354
This PR addresses the issue where InMemoryBlockingCache was not guaranteed to process CRUD operations sequentially due to limitations in using a single-threaded dispatcher. The implementation has been updated to use an Actor, which ensures strict sequential processing of operations, thereby improving thread safety and atomicity.

  • Replaced the single-threaded dispatcher-based coroutine scope with an Actor.
  • Updated the internal state management logic to process CRUD operations exclusively within the Actor.
  • Ensured all operations (create, read, update, delete) are processed in the correct order and no race conditions occur.

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

@manas-yu manas-yu requested a review from a team as a code owner December 19, 2024 11:12
@manas-yu manas-yu requested a review from BenHenning December 19, 2024 11:12
@manas-yu manas-yu marked this pull request as draft December 19, 2024 11:19
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.

[BUG]: InMemoryBlockingCache is not thread-safe
1 participant