cherry-pick(4.3-stable): Android ANR deadlock between CSS updates-registry lock and Fabric commit (#9715)#9849
Merged
MatiPl01 merged 2 commits intoJul 3, 2026
Conversation
…he commit deadlock Resolving a relative CSS length (e.g. a transformOrigin mixing % and px) read the live ShadowTree, which takes the ShadowTree commit lock, while the CSS flush holds the updates-registry lock; a concurrent Fabric commit takes the same two locks in the opposite order, so they deadlock (AB-BA) when RN's preventShadowTreeCommitExhaustion flag holds the commit lock across the commit hooks. This branch got that lock shape with #9323, which replaced the per-registry flush locks with the single updates-registry lock the commit hook also takes. Port of #9715's approach to 4.3: ReanimatedMountHook records the mounted root per surface and ViewStylesRepository resolves nodes from that snapshot via plain tree walks, so the read path never takes the ShadowTree lock. Unlike main, transition setup here resolves relative lengths on the JS thread without the updates-registry lock, so the snapshot map is guarded by its own leaf mutex.
tomekzaw
approved these changes
Jul 3, 2026
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
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.
Summary
Cherry-picking for Reanimated 4.3.2 release
The original commit doesn't apply to 4.3-stable, so this PR ports the analogous fix. Two adjustments: there's no
USE_ANIMATION_BACKENDbranch (4.3 has no animation backend), and the snapshot map gets its own mutex because 4.3 also resolves relative lengths on the JS thread, outside the registry lock.