Repository navigation
feat: Add option to skip sending previous run envelopes - #2332
Draft
Sebassmaster wants to merge 2 commits into
Draft
Sebassmaster wants to merge 2 commits into
Sebassmaster wants to merge 2 commits into
Conversation
When a send hangs at shutdown, unsent envelopes are dumped to the run folder and resent by the next sentry_init, which hangs again. With sentry_options_set_send_previous_run_envelopes(opts, 0), leftovers stay on disk and are sent by a later run with the option enabled. Crash callbacks and session finalization still run. Refs #929
Sebassmaster
force-pushed
the
feat/option-skip-old-runs
branch
from
November 20, 2026 18:47
008793b to
28abef2
Compare
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v1 #2332 +/- ##
==========================================
+ Coverage 75.72% 75.79% +0.07%
==========================================
Files 105 105
Lines 30936 30985 +49
Branches 5775 5783 +8
==========================================
+ Hits 23426 23485 +59
+ Misses 6075 6064 -11
- Partials 1435 1436 +1 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Adds
sentry_options_set_send_previous_run_envelopes(opts, int)(default: enabled). When disabled,sentry_initdoesn't send envelopes left over from previous runs; they stay in their run folder and are sent by a later run with the option enabled.Why
When a send hangs (DNS not answering, unreachable host),
sentry_closewaits out the shutdown timeout, dumps the queue to disk, and the nextsentry_initresends it, which hangs again. The delay repeats every run and the leftovers pile up by one envelope per run. The curl abort from #1585 can't reliably stop this: during connect, curl calls the progress callback ~1/s (vs. 250 ms grace), and during DNS it only returns after the pendinggetaddrinfo(~10 s). Details and measurements:What changes
session.jsonfiles are finalized (crashed/abnormal) and written as envelopes into their run folder.on_crashed_last_runstill fires, once per crash.nativeandcrashpadbackends, crash reports are uploaded by the crash handler and aren't affected.Notes for review
.crashmarker before the callback is now the only thing preventingon_crashed_last_runfrom firing again on every start (previously, deleting the run folder also hid a missing marker deletion).send_previous_run_envelopes_disabled_fires_crash_callback_oncecovers this: with the marker deletion commented out it fails, while the existingon_crashed_last_runstill passes.Tests
send_previous_run_envelopes_disabled_{keeps_envelopes,fires_crash_callback_once,marks_one_session_crashed}test_send_previous_run_envelopes_disabled(inproc, breakpad)Refs #929
Refs NATIVE-59