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

[PLAT-7139] Thermal state and Thermal Kill detection #1171

Merged
merged 6 commits into from Aug 25, 2021

Conversation

nickdowell
Copy link
Contributor

@nickdowell nickdowell commented Aug 23, 2021

Goal

Detect Thermal Kill errors (where the OS terminates an app due to a device overheating), add a thermalState property to the device tab, and add thermal state change breadcrumbs.

Changeset

  • Records thermalState (in metaData) and observe thermal state notifications (to add breadcrumbs) on all supported platforms (requires iOS / tvOS 11.0 or later)
  • Records critical thermal state in KV-store, and uses this at start-up to classify an unexpected termination as a Thermal Kill instead of an OOM. OOM heuristic has been refactored into BugsnagSystemState as "unexpected termination" detection. Thermal Kill events have the same payload as OOM events (no stacktrace or threads) but different errorClass, message and type.
  • Refactored some notification observation code to follow consistent naming pattern and remove duplicates.
  • Renamed BSGGlobals to BSGUtils in order to rehome UIDeviceOrientation -> NSString function

Testing

E2E scenario verifies that a Thermal Kill is reported if an app is killed while the thermal state is critical.

E2E scenarios verify that thermal state metadata and breadcrumbs are recorded.

Successful full E2E run: https://buildkite.com/bugsnag/bugsnag-cocoa/builds/3178

Unit test case for OOMs has been amended to verify logic now residing in BugsnagSystemState

@github-actions
Copy link

Infer: No issues found 🎉

OCLint: No issues found 🎉

Bugsnag.framework binary size increased by 1,936 bytes from 1,154,472 to 1,156,408

Generated by 🚫 Danger

@nickdowell nickdowell merged commit beb4f2f into master Aug 25, 2021
@nickdowell nickdowell deleted the nickdowell/thermal-state branch August 25, 2021 07:37
nickdowell added a commit that referenced this pull request Aug 25, 2021
@nickdowell nickdowell mentioned this pull request Sep 1, 2021
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.

None yet

2 participants