-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(native): clarifying crashpad behavior #13689
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8485f4f
reposition line about Docker
JoshuaMoelans 5358ecc
add heading
JoshuaMoelans cba3210
Update index.mdx
JoshuaMoelans 0efe33d
apply suggestion
JoshuaMoelans b919e68
Add Container Environments page
JoshuaMoelans 32a425e
Apply suggestions from code review
JoshuaMoelans 9d2ff88
apply adapted suggestion from code review
JoshuaMoelans File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
31 changes: 31 additions & 0 deletions
31
docs/platforms/native/advanced-usage/container-environments/index.mdx
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
| 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 | ||
| ``` |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Not sure about this change, I meant
whenas inif, since not all apps run into this problem (only when they are running in a systemd/docker env.)