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 possible deadlock in dispatchViewUpdates #43643

Closed
wants to merge 1 commit into from

Conversation

EvertEt
Copy link
Contributor

@EvertEt EvertEt commented Mar 25, 2024

Summary:

In th3rdwave/react-native-safe-area-context#448 it was noticed that from 0.72 (bc766ec #35889) it was possible to get a deadlock in dispatchViewUpdates. (More details)

This deadlock resulted in a laggy experience for all users using https://github.com/th3rdwave/react-native-safe-area-context/ on Android.

To avoid this problem, the author of the original fix proposed this solution which was tested by Discord and many other users.

It would be great to have this backported to 0.72 and 0.73 because of the large userbase using react-native-safe-area-context since it's recommended by expo and react-navigation.

Changelog:

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

Test Plan:

The original memory leak remains fixed, and can be verified in https://github.com/feiyin0719/RNMemoryLeakAndroid.

To verify the deadlock is gone, every app using https://github.com/th3rdwave/react-native-safe-area-context will work smoothly and not log any excessive Timed out waiting for layout
(https://github.com/17Amir17/SafeAreaContext)

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Mar 25, 2024
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 18,450,661 +80
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,815,643 -4,079
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 8a2cf68
Branch: main

@facebook-github-bot
Copy link
Contributor

@zeyap has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@efstathiosntonas
Copy link

efstathiosntonas commented Mar 26, 2024

@cortinico @cipolleschi @NickGerleman just a heads up, this is a big issue for us :/

edit: there's no discussion about 0.73.7/0.72.13 so I tagged you here

@vanHoi
Copy link

vanHoi commented Mar 26, 2024

This would be a great fix for us, as we are currently building React Native from source to apply this fix every time!

@NickGerleman
Copy link
Contributor

edit: there's no discussion about 0.73.7/0.72.13 so I tagged you here

@efstathiosntonas cherry pick request can be made here: https://github.com/reactwg/react-native-releases/issues

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 26, 2024
@facebook-github-bot
Copy link
Contributor

@zeyap merged this pull request in b2ca41e.

@efstathiosntonas
Copy link

@NickGerleman thanks for the heads up, I've opened a cherry-pick request/issue

alanjhughes pushed a commit that referenced this pull request Apr 9, 2024
Summary:
In th3rdwave/react-native-safe-area-context#448 it was noticed that from 0.72 (bc766ec #35889) it was possible to get a deadlock in dispatchViewUpdates. ([More details](th3rdwave/react-native-safe-area-context#448 (comment)))

This deadlock resulted in a laggy experience for all users using https://github.com/th3rdwave/react-native-safe-area-context/ on Android.

To avoid this problem, the author of the original fix [proposed](th3rdwave/react-native-safe-area-context#448 (comment)) this solution which was tested by Discord and many other users.

It would be great to have this backported to 0.72 and 0.73 because of the large userbase using react-native-safe-area-context since it's recommended by expo and react-navigation.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

Pull Request resolved: #43643

Test Plan:
The original memory leak remains fixed, and can be verified in https://github.com/feiyin0719/RNMemoryLeakAndroid.

To verify the deadlock is gone, every app using https://github.com/th3rdwave/react-native-safe-area-context will work smoothly and not log any excessive `Timed out waiting for layout`
(https://github.com/17Amir17/SafeAreaContext)

Reviewed By: arushikesarwani94

Differential Revision: D55339059

Pulled By: zeyap

fbshipit-source-id: c067997364fbec734510ce99b9994e89d044384a
cortinico pushed a commit that referenced this pull request Apr 9, 2024
Summary:
In th3rdwave/react-native-safe-area-context#448 it was noticed that from 0.72 (bc766ec #35889) it was possible to get a deadlock in dispatchViewUpdates. ([More details](th3rdwave/react-native-safe-area-context#448 (comment)))

This deadlock resulted in a laggy experience for all users using https://github.com/th3rdwave/react-native-safe-area-context/ on Android.

To avoid this problem, the author of the original fix [proposed](th3rdwave/react-native-safe-area-context#448 (comment)) this solution which was tested by Discord and many other users.

It would be great to have this backported to 0.72 and 0.73 because of the large userbase using react-native-safe-area-context since it's recommended by expo and react-navigation.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

Pull Request resolved: #43643

Test Plan:
The original memory leak remains fixed, and can be verified in https://github.com/feiyin0719/RNMemoryLeakAndroid.

To verify the deadlock is gone, every app using https://github.com/th3rdwave/react-native-safe-area-context will work smoothly and not log any excessive `Timed out waiting for layout`
(https://github.com/17Amir17/SafeAreaContext)

Reviewed By: arushikesarwani94

Differential Revision: D55339059

Pulled By: zeyap

fbshipit-source-id: c067997364fbec734510ce99b9994e89d044384a
alfonsocj pushed a commit that referenced this pull request Apr 12, 2024
Summary:
In th3rdwave/react-native-safe-area-context#448 it was noticed that from 0.72 (bc766ec #35889) it was possible to get a deadlock in dispatchViewUpdates. ([More details](th3rdwave/react-native-safe-area-context#448 (comment)))

This deadlock resulted in a laggy experience for all users using https://github.com/th3rdwave/react-native-safe-area-context/ on Android.

To avoid this problem, the author of the original fix [proposed](th3rdwave/react-native-safe-area-context#448 (comment)) this solution which was tested by Discord and many other users.

It would be great to have this backported to 0.72 and 0.73 because of the large userbase using react-native-safe-area-context since it's recommended by expo and react-navigation.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

Pull Request resolved: #43643

Test Plan:
The original memory leak remains fixed, and can be verified in https://github.com/feiyin0719/RNMemoryLeakAndroid.

To verify the deadlock is gone, every app using https://github.com/th3rdwave/react-native-safe-area-context will work smoothly and not log any excessive `Timed out waiting for layout`
(https://github.com/17Amir17/SafeAreaContext)

Reviewed By: arushikesarwani94

Differential Revision: D55339059

Pulled By: zeyap

fbshipit-source-id: c067997364fbec734510ce99b9994e89d044384a
douglowder pushed a commit to react-native-tvos/react-native-tvos that referenced this pull request Apr 22, 2024
Summary:
In th3rdwave/react-native-safe-area-context#448 it was noticed that from 0.72 (facebook/react-native@bc766ec facebook/react-native#35889) it was possible to get a deadlock in dispatchViewUpdates. ([More details](th3rdwave/react-native-safe-area-context#448 (comment)))

This deadlock resulted in a laggy experience for all users using https://github.com/th3rdwave/react-native-safe-area-context/ on Android.

To avoid this problem, the author of the original fix [proposed](th3rdwave/react-native-safe-area-context#448 (comment)) this solution which was tested by Discord and many other users.

It would be great to have this backported to 0.72 and 0.73 because of the large userbase using react-native-safe-area-context since it's recommended by expo and react-navigation.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

Pull Request resolved: facebook/react-native#43643

Test Plan:
The original memory leak remains fixed, and can be verified in https://github.com/feiyin0719/RNMemoryLeakAndroid.

To verify the deadlock is gone, every app using https://github.com/th3rdwave/react-native-safe-area-context will work smoothly and not log any excessive `Timed out waiting for layout`
(https://github.com/17Amir17/SafeAreaContext)

Reviewed By: arushikesarwani94

Differential Revision: D55339059

Pulled By: zeyap

fbshipit-source-id: c067997364fbec734510ce99b9994e89d044384a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Slow screen opening after react-native update
6 participants