Repository navigation
ref: remove options lock from sentry_envelope - #2248
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2248 +/- ##
==========================================
+ Coverage 75.57% 75.65% +0.08%
==========================================
Files 103 103
Lines 28266 28255 -11
Branches 5180 5180
==========================================
+ Hits 21361 21376 +15
+ Misses 5563 5533 -30
- Partials 1342 1346 +4 🚀 New features to boost your workflow:
|
mujacica
approved these changes
Oct 27, 2026
jpnurmi
force-pushed
the
jpnurmi/ref/envelope-options
branch
from
October 27, 2026 11:30
4b0656c to
54169f4
Compare
Taking `g_options_lock` in `sentry__envelope_new()` and `sentry__envelope_add_event()` was a footgun for threads that a lock holder waits on, such as the inproc handler thread that `sentry_close()` joins while holding the lock. Take the DSN and `traces_sample_rate` from the caller's options instead. `NULL` options mean no DSN header and a `traces_sample_rate` of 0. `sentry__envelope_new_with_dsn()` stays for the batcher, which holds only a DSN reference. Ref: #2244
jpnurmi
force-pushed
the
jpnurmi/ref/envelope-options
branch
from
October 27, 2026 14:41
54169f4 to
06c3572
Compare
JoshuaMoelans
approved these changes
Oct 28, 2026
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.
Taking
g_options_lockviaSENTRY_WITH_OPTIONSdeep insentry__envelope_new()was a footgun. Creating envelopes from any other thread duringsentry_close()would deadlock.Just pass the options - most production code callers already have a reference, anyway.
NULLoptions, which is mostly needed in tests, create an envelope without a DSN header.sentry__envelope_new_with_dsn()stays for the batcher, which holds only a DSN reference.Partial fix to: #2244