fix: reset boot_fail_count before OTA restart to prevent false recovery#10983
Open
huhuanming wants to merge 12 commits intorelease/v6.1.0from
Open
fix: reset boot_fail_count before OTA restart to prevent false recovery#10983huhuanming wants to merge 12 commits intorelease/v6.1.0from
huhuanming wants to merge 12 commits intorelease/v6.1.0from
Conversation
When installBundle completes and schedules RNRestart.restart(), the process is force-killed without triggering Activity.onStop(), so the boot_fail_count is never reset. If the previous boot was short-lived (e.g. OTA install completed during early initialization), the counter stays elevated and subsequent restarts quickly accumulate to the threshold of 3, falsely triggering recovery mode. Call BootRecovery.markBootSuccess() before every planned RNRestart in installBundle, restart, and switchBundle to reset the counter, since these are intentional restarts and not crash-loops.
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
limichange
approved these changes
Apr 1, 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
installBundlecompletes,RNRestart.restart()force-kills the process without triggeringActivity.onStop(), soboot_fail_countis never resetBootRecovery.markBootSuccess()(wrapped in try/catch) before every plannedRNRestartininstallBundle,restart, andswitchBundleto reset the counter, since these are intentional restarts — not crash-loopsRoot Cause
Timeline reproduced from actual Android logs:
boot_fail_count0→1, loads bundle 7366896installBundlecompletes, schedulesRNRestart.restart()onStop()never called, count stays at 1Test plan
switchBundleto switch to another bundle version, confirm recovery mode is not triggered