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

Avoid deadlock in RealMutableStore #658

Merged
merged 4 commits into from
Oct 4, 2024

Conversation

amrfarid140
Copy link
Contributor

Closes #657

Description

The change ensures that the store lock is always released from withThreadSafety regardless of the execution result of threadSafety.block().

This helps in avoiding the lock being in a locked state when a cancellation exception is propagated from downstream.

The test mentioned in the issue and added here now passes 100% of the time. Of course happy to delete it (or move it somewhere else) before merging.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Test Plan

See unit test

Checklist:

Before submitting your PR, please review and check all of the following:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective
  • New and existing unit tests pass locally with my changes

Additional Notes:

Add any other information about the PR here.

@matt-ramotar matt-ramotar merged commit 067bd41 into MobileNativeFoundation:main Oct 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] MutableStore occasionally hangs when cancelling streams
3 participants