-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apple): Rename the OOM integration (#5938)
OOM is now called watchdog terminations. See getsentry/sentry-cocoa#2499, which will be part of the 8.0.0 release of sentry-cocoa. Co-authored-by: Isabel <[email protected]> Co-authored-by: Philipp Hofmann <[email protected]>
- Loading branch information
1 parent
3bcff8f
commit 2101195
Showing
3 changed files
with
63 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
48 changes: 48 additions & 0 deletions
48
src/platforms/apple/common/configuration/watchdog-terminations.mdx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: Watchdog Terminations | ||
sidebar_order: 10 | ||
description: "Learn how to turn off Watchdog Termination tracking" | ||
--- | ||
|
||
<Note> | ||
This integration is available since version 8.0.0 of Sentry Apple SDK. It was named <PlatformLink to="/configuration/out-of-memory/">Out of Memory</PlatformLink> before the 8.0.0 release. | ||
</Note> | ||
|
||
This integration tracks [watchdog terminations](https://developer.apple.com/documentation/xcode/addressing-watchdog-terminations) based on heuristics. This feature is available for iOS, tvOS, and Mac Catalyst, works only if the application was in the foreground, and doesn't track watchdog terminations for unit tests. | ||
|
||
When a typical unhandled error occurs, the Apple SDK writes a report to disk with the current state of your application, with details like the stack trace, tags, breadcrumbs, and so on, before the app terminates. When the watchdog terminates your app this happens without further notice, which means the SDK can't write a report to disk. A common reason the watchdog can terminate your app is an Out Of Memory problem. If the app is terminated because it hangs, we don't create a watchdog termination event, but instead an `AppHangs` event is created. | ||
|
||
As a result, in the Apple SDK, we track watchdog terminations during the app start based on heuristics, but getting the state of the app when a watchdog termination occurs is challenging. To provide the same state as we do for a typical crash, we would periodically need to store the app state to disk. This would cause a lot of I/O, which in turn could negatively affect the application's performance. To avoid this, watchdog termination events have less context than typical unhandled errors. Breadcrumbs are stored to disk and are added to watchdog termination events to help you figure out where in the app the event happened. This is done by appending the breadcrumbs to an open file, which should have a marginal impact on your app's performance. | ||
|
||
When a user launches the app, the SDK checks the following statements and reports a watchdog termination if all of them are true: | ||
|
||
- The app didn't crash on the previous run. | ||
- The app was in the foreground/active. | ||
- The user launched the app at least once. When your app was killed by the watchdog during the first launch, the SDK can't detect it. | ||
- There was no debugger attached to the process of the app. (If there was, our logic would falsely report watchdog terminations whenever you restarted the app in development.) | ||
- The app was not running on a simulator. | ||
- The OS didn't update your app. | ||
- The user didn't update the OS of their device. | ||
- The user didn't terminate the app manually, and neither did the OS. | ||
|
||
If you're interested in the implementation details, you can check out [the code](https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryWatchdogTerminationsLogic.m) to find out more. | ||
|
||
If you'd like to opt out of this feature, you can do so using options: | ||
|
||
```swift {tabTitle:Swift} | ||
import Sentry | ||
|
||
SentrySDK.start { options in | ||
options.dsn = "___PUBLIC_DSN___" | ||
options.enableWatchdogTerminationTracking = false | ||
} | ||
``` | ||
|
||
```objc {tabTitle:Objective-C} | ||
@import Sentry; | ||
|
||
[SentrySDK startWithConfigureOptions:^(SentryOptions *options) { | ||
options.dsn = @"___PUBLIC_DSN___"; | ||
options.enableWatchdogTerminationTracking = NO; | ||
}]; | ||
``` |
2101195
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
sentry-docs – ./
sentry-docs-git-master.sentry.dev
sentry-docs.sentry.dev
docs.sentry.io