Repository navigation
fix(android): allow GC suspension and attach disposal dispatchers to JNI - #354
wildseansy wants to merge 1 commit into
Conversation
|
🍋 Code Reviewer / QA: LGTM at |
|
🍋 Code Reviewer / QA: Follow-up: a temporary branch combining #354–356 built upstream AppExampleFabric (RN 0.83.1, Android arm64 debug) successfully. On an Android 16 emulator, CameraPan and AnimationTransitions rendered and returned to Home without an observed app crash. This was a bounded smoke check using release prebuilt engine libraries, not exhaustive GC stress; the example's existing HybridObject self-test error and StrictMode warnings remain separate limitations. |
|
🥭 Tech Lead: This PR is now open for review at Could a repository maintainer approve the pending Build Android and Validate C++ workflow runs? Both currently report The description now reflects the review status and links these runs. Its existing local-build and bounded emulator results remain the validation evidence; no new runtime test or upstream CI pass is claimed. |
Fixes #351.
Repeated scene replacement on an Android 16 arm64 emulator produced
HeapTaskDaemon/SuspendAll timeoutaborts while the renderer waited in native code.FilamentChoreographer.onFrameis potentially blocking, so using ordinary JNI instead of@FastNativelets ART suspend the thread for GC.Resource disposal can also be scheduled from Hermes GC threads.
JDispatcher::scheduleTrigger()now uses fbjniThreadScope::WithClassLoaderaround both the Java method lookup and invocation, attaching an otherwise unattached caller for that scope.No JS API changes.
Validation
yarn check-allpasses with Yarn Classic 1.22.22 and clang-format 16, using dependencies installed from the frozen upstream Bun lockfile. Separate fullyarn lintandyarn typescriptalso pass; no source formatting changes were required.git diff --checkpass for the changed C++ file/diff.Fresh upstream Android example validation
A temporary QA checkout based on upstream
0bcf507combined the three independent PR changes (#354, #355, #356). The unmodified AppExampleFabric app (React Native 0.83.1) built for Android arm64 in 3m26s. Its native engine/Bullet binaries came from the verified upstream 1.11.0 package; tracked engine headers matched byte for byte. This is a combined integration build, not three separate example APK builds.On an Android 16 arm64 emulator, Home → CameraPan → Home → AnimationTransitions → Home rendered both native models. The process remained alive and its crash buffer was empty during this bounded run. Initial blank startup resolved after restarting with Metro ready, without source changes.
The example's built-in HybridObject smoke test still reports an invalid-enum error when reading the initial enum in unchanged upstream test code (
RNFTestHybridObjectleaves that field uninitialized). StrictMode warnings also remain. This result establishes bounded rendering/navigation, not a clean pass of every runtime test, the newly documented material-lifetime cases, or physical-device/iOS validation.Upstream CI
This PR is open for review. At head
423556686d9314dc1ce5389cdc2a7fa715944394, the Build Android and Validate C++ workflows reportaction_requiredand need repository-maintainer approval. The local checks recorded above do not establish an upstream CI pass.