Skip to content

Resources: modified AsyncCache to use Dispatchers.Unconfined - #5688

Merged
Konstantin (terrakok) merged 2 commits into
masterfrom
anr-fix
Aug 10, 2026
Merged

Resources: modified AsyncCache to use Dispatchers.Unconfined#5688
Konstantin (terrakok) merged 2 commits into
masterfrom
anr-fix

Conversation

@terrakok

@terrakok Konstantin (terrakok) commented Aug 6, 2026

Copy link
Copy Markdown
Member

Resources: modified AsyncCache to use Dispatchers.Unconfined and start shared requests lazily outside the critical mutex section.

The issue was that, inside AsyncCache, requests to the same resource were reused via async, which by default scheduled its work on Dispatchers.Default. That dispatcher could be overloaded with tasks, which in turn forced the Main thread to wait longer than allowed, resulting in an ANR.

Fixes https://youtrack.jetbrains.com/issue/CMP-6615

Testing

Added new unit tests

Release Notes

Fixes - Resources

  • Fixed android ANR when Dispatchers.Default is overloaded.

…start shared requests lazily outside the critical mutex section.
@terrakok
Konstantin (terrakok) merged commit 47d17f8 into master Aug 10, 2026
1 check passed
@terrakok
Konstantin (terrakok) deleted the anr-fix branch August 10, 2026 13:12
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.

2 participants