chore(android): Mark MemoryLimiter sessions as having exited abnormally (JAVA-687) - #6113
Open
0xadam-brown wants to merge 2 commits into
Open
0xadam-brown wants to merge 2 commits into
0xadam-brown wants to merge 2 commits into
Conversation
…ly (JAVA-687) Mark recovered MemoryLimiter exits as abnormal session endings so release health no longer treats the terminated process as a healthy exit. Reuse the existing AbnormalExit cache repair path with a stable memory_limiter mechanism and the OS exit timestamp.
📲 Install BuildsAndroid
|
0xadam-brown
marked this pull request as ready for review
September 15, 2026 10:14
0xadam-brown
requested review from
adinauer,
markushi,
romtsn and
runningcode
as code owners
September 15, 2026 10:14
9 tasks
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e3d925c. Configure here.
0xadam-brown
commented
Sep 15, 2026
| * | ||
| * <p><b>Note:</b> Some existing discriminator code (`instanceof AbnormalExit`) is shaped by the | ||
| * historical ANR-only usage of this interface. New implementations should review all of those call | ||
| * sites carefully to ensure ANR-specific behavior isn't applied accidentally. |
Member
Author
There was a problem hiding this comment.
(Fyi, I checked those call sites in connection with the work here, and we didn't need to make any changes.)
0xadam-brown
marked this pull request as draft
September 15, 2026 13:03
This comment was marked as resolved.
This comment was marked as resolved.
…rocessor + address bugbot issue.
0xadam-brown
marked this pull request as ready for review
September 15, 2026 14:18
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.

📜 Description
Follow up to #6111.
PR marks recovered MemoryLimiter exits as abnormal session endings so release health no longer treats the terminated process as a healthy exit.
To do so, we piggyback on the existing
AbnormalExitrepair path currently used by ANRs. That makes sense as it's the sanctioned path for sessions that end abnormally, which fits MemoryLimiter kills.Note: The possible session states are: Ok (ie, start state / pre-exit), Exited (normal exit), Crashed, Abnormal, and Unhandled (used by Flutter). See here.
💡 Motivation and Context
#6111 introduced the event path for generating SentryEvents from ApplicationExitInfo records produced by MemoryLimiter process kills. This PR finishes that work by adding the session-repair path. Without it, previous session records would report healthy exits when in fact they'd been killed via the MemoryLimiter.
The PR works by having MemoryLimiterHint implement the
AbnormalExitinterface, just likeAnrHintandAnrV2Hintdo today. That interface is read by:Because MemoryLimiterHint implements
Backfillable, it's not sent to the MainEventProcessor, and hence it isn't given a record of the current process's threads. That's good b/c the current process isn't the one that was killed. (AnrV2Hint similarly implements Backfillable and skips MainEventProcessor.)addresses: JAVA-687
💚 How did you test it?
Unit tests + I had my clanker manually test behavior against the (yet-to-be introduced) MemoryLimiter sample app.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog (the CHANGELOG entry from #6111 covers both it and this, as we'll merge both PRs simultaneously / incorporate them into the same release.