fix(logs): add logs flush on crash#1404
Merged
Merged
Conversation
…crash # Conflicts: # CHANGELOG.md # tests/test_integration_crashpad.py
this eliminates boilerplate noise in the tests but also reduces the chance of forgetting it in a test.
… it since we flush anyway.
supervacuus
approved these changes
Oct 15, 2025
Collaborator
supervacuus
left a comment
There was a problem hiding this comment.
LGTM ❤️
The only thing I ask you to do now is to reduce the logs or move them to the TRACE level.
… cleaning in the pytest configuration
this means when it does its clearing a TEST_CHECK cannot assume that a directory even exists (in which case clear_crash_marker would actually fail versus the case were only the marker file didn't exist).
Collaborator
|
@JoshuaMoelans, do you still want to add something here, or is this ready to merge from your point of view? |
Member
Author
|
@supervacuus good to go from my perspective! 🚀 |
1 task
BernhardMarconato
pushed a commit
to elgatosf/sentry-native
that referenced
this pull request
Apr 21, 2026
* Add logs-on-crash * skip crashpad test on macos * add straight-to-disk writing of log envelopes if crashing * CHANGELOG.md * restore thread join for normal shutdown * directly take log item from httpserver log for crashpad test * update CHANGELOG.md * we know which envelope has the log * we **don't** know which envelope has the log * add more general request fetch from httpserver function * add logs return value checks * fix tsan global data race on logs validation * move database-path cleanup into the cmake build cache fixture this eliminates boilerplate noise in the tests but also reduces the chance of forgetting it in a test. * in the crash-safe logs flush detach the batcher thread and don't wake it since we flush anyway. * don't clean for unit-test crash_marker * don't detach in crash-safe but spin-lock in its flusher to acquire flushing. * add clean parameter to cmake fixture * ensure logs flushing in crash handlers happens within the handler sync bounds. * bound the spin lock in the logs flusher during crash-safe mode * exclude crashed_last_run unit-test from cleaning database paths * use an unsigned integer for the sleep_time of the crash-safe logs flusher spinlock * provide cross-platform cpu_relax and replace syscall sleep with spinners. * isolate `crash_marker` unit test and eliminate exceptions to database cleaning in the pytest configuration * platform path special case in crash_marker unit test * crashed_last_run can no longer assume that a database path exists this means when it does its clearing a TEST_CHECK cannot assume that a directory even exists (in which case clear_crash_marker would actually fail versus the case were only the marker file didn't exist). * clean up log statements * bump CI python to 3.12 * fix CHANGELOG.md --------- Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1403
Part of #1398