Skip to content

Awaiting root unmount promises#3824

Open
nathan-ahn wants to merge 1 commit intoShopify:mainfrom
nathan-ahn:nathan/await-root-unmount-promises
Open

Awaiting root unmount promises#3824
nathan-ahn wants to merge 1 commit intoShopify:mainfrom
nathan-ahn:nathan/await-root-unmount-promises

Conversation

@nathan-ahn
Copy link
Copy Markdown
Contributor

Description

Awaits the promises returned by root.unmount to avoid potential race conditions leading to memory leak bugs. This fix may have detrimental impacts depending on how long skiaReconciler.updateContainer takes, but I believe that memory safety and reliability are more important.

Context

This pull request attempts to fix memory leaks reported in #3769. We've been testing this fix (amongst others) in production for the past 12 hours. So far, we haven't seen any memory issues since deploying.

Additional Notes

There's one useEffect in Canvas.tsx in which the root.unmount wasn't changed and is left unawaited. This is pretty standard for useEffects, but may be worth investigating to make sure there's no risk for memory leak race conditions there.

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.

1 participant