Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The Native SDK lets users decide at compile-time between three crash backends:
* `breakpad`
* `inproc`

### Why is `crashpad` the default?

Currently, `crashpad` is the default on all desktop platforms because it

* has an external `handler` process that allows for external snapshots and sending crash reports immediately (instead of on the next successful start of your application)
Expand All @@ -26,6 +28,9 @@ Currently, `crashpad` is the default on all desktop platforms because it
* cooperation with Epic's Easy Anti-Cheat
* CMake build scripts (some users use our backend handler forks solely because of this reason)

<Alert>
When your deployment scenario should wait for the `crashpad_handler` to finish its work before a shutdown-after-crash (systemd, Docker), in Linux environments since SDK version [0.8.3](https://github.com/getsentry/sentry-native/releases/tag/0.8.3), you can enable the [option `crashpad_wait_for_upload`](/platforms/native/configuration/options/#crashpad-wait-for-upload) to delay application shutdown until the upload of the crash report is completed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When your deployment scenario should wait for the `crashpad_handler` to finish its work before a shutdown-after-crash (systemd, Docker), in Linux environments since SDK version [0.8.3](https://github.com/getsentry/sentry-native/releases/tag/0.8.3), you can enable the [option `crashpad_wait_for_upload`](/platforms/native/configuration/options/#crashpad-wait-for-upload) to delay application shutdown until the upload of the crash report is completed.
While your deployment scenario should wait for the `crashpad_handler` to finish its work before a shutdown-after-crash (systemd, Docker), in Linux environments since SDK version [0.8.3](https://github.com/getsentry/sentry-native/releases/tag/0.8.3), you can enable the [option `crashpad_wait_for_upload`](/platforms/native/configuration/options/#crashpad-wait-for-upload) to delay application shutdown until the upload of the crash report is completed.

Copy link
Member Author

@JoshuaMoelans JoshuaMoelans May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this change, I meant when as in if, since not all apps run into this problem (only when they are running in a systemd/docker env.)

</Alert>
### When shouldn't I use the `crashpad` backend?

Sentry decided on `crashpad` as the default on all platforms because it offers numerous advantages. However, there are use cases where `crashpad` cannot be used or makes distribution or deployment much harder. We provide other backends for situations when
Expand All @@ -38,8 +43,6 @@ Sentry decided on `crashpad` as the default on all platforms because it offers n

In the above cases, if you cannot loosen the requirements of your environment, you have to choose an in-process backend (meaning either `breakpad` or `inproc`).

When your deployment scenario should wait for the `crashpad_handler` to finish its work before a shutdown-after-crash (systemd, Docker), you can enable the option [`crashpad_wait_for_upload`](/platforms/native/configuration/options/#crashpad-wait-for-upload) to delay application shutdown until the upload of the crash report is completed.

### How do I decide between `breakpad` or `inproc`?

Both backends are comparable in how they differ from `crashpad`. However, there are also considerable differences between the two:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Container Environments
description: "How to use the Sentry Native SDK in container environments."
sidebar_order: 2000
---

## Database Path on a Mounted Volume
The Sentry Native SDK uses a [database path](https://docs.sentry.io/platforms/native/configuration/options/#database-path) to store events and crash reports. When you are using a containerized environment, you may want to mount a volume to persist the database across container restarts to avoid losing this data.

## Waiting for `Crashpad` to Finish
Starting with SDK version [0.8.3](https://github.com/getsentry/sentry-native/releases/tag/0.8.3), the [option `crashpad_wait_for_upload`](https://docs.sentry.io/platforms/native/configuration/options/#crashpad-wait-for-upload) allows the application (on Linux) to wait for the `crashpad_handler` to finish before a shutdown-after-crash.

In SDK versions older than 0.8.3, you could use a script similar to the example below to tie container shutdown to the `crashpad_handler` process:
```bash
#!/bin/bash

# ./execute-main-app

crashpad_timeout_s=10
crashpad_process_name=crashpad_handler
crashpad_pid=$(pgrep -n -f $crashpad_process_name)
if [ -n "$crashpad_pid" ]; then
echo "Waiting for crashpad to finish..."
timeout $crashpad_timeout_s tail --pid=$crashpad_pid -f /dev/null
if [ $? -eq 124 ]; then
echo "The crashpad process did not finish within $crashpad_timeout_s seconds"
else
echo "The crashpad process finished successfully"
fi
fi
```