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

Fatal App Hang Duration #4845

Open
Tracked by #4261
philipphofmann opened this issue Feb 13, 2025 · 0 comments
Open
Tracked by #4261

Fatal App Hang Duration #4845

philipphofmann opened this issue Feb 13, 2025 · 0 comments
Assignees

Comments

@philipphofmann
Copy link
Member

Description

With #2216, the SDK measures the duration of app hangs. After we finish reporting fatal app hangs, we could also try to measure the duration of fatal app hangs.

The ANRTrackerV2 could periodically update a timestamp to disk during an ongoing ANR. When the OS terminates the app, we can calculate the difference between the timestamp of the stored app hang event and the onGoingAppHangTimeStamps to calculate the rough app hang duration.

It's worth noting that the AppHangV2Tracker can run for another 5 seconds until it gets terminated because when the user closes an app via a swipe-up gesture because the app gets around 5 seconds for cleanup tasks; see applicationWillTerminate. We can approve this behavior with test observations. When the OS watchdog kills the app process due to an app hang the AppHangTracker doesn't continue to run. Sadly, we can't reliably stop the AppHangV2Tracker on applicationWillTerminate because the OS posts this on the main thread and the main thread is blocked by the app hang. If we somehow identify if the app gets terminated by the user, by, for example, checking the applicationState, we could differentiate fatal app hangs between user terminated, and OS terminated, but further investigations are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant