Skip to content

feat: add sentry_set_release/environment#1555

Merged
jpnurmi merged 8 commits into
masterfrom
jpnurmi/feat/update-release-env
Mar 9, 2026
Merged

feat: add sentry_set_release/environment#1555
jpnurmi merged 8 commits into
masterfrom
jpnurmi/feat/update-release-env

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Mar 5, 2026

Copy link
Copy Markdown
Collaborator

Add post-init setters for release and environment, allowing apps to update these values after SDK init, without requiring a full shutdown and re-init.

The new values are stored on the scope (like user), keeping options immutable after init. Sessions pick up the new values when manually started after calling the setters.

Close: #1516

Add post-init setters for release and environment, allowing apps to
update these values after SDK init without full re-init.

The new values are stored on the scope (like user), keeping options
immutable after init. Sessions pick up the new values when manually
started after calling the setters.

Close: #1516
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 8856877

jpnurmi and others added 3 commits March 5, 2026 18:55
Acquire options lock before scope lock in sentry_set_release_n and
sentry_set_environment_n to match the lock order used by sentry_init
(options → scope), fixing a potential deadlock detected by TSan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use SENTRY_WITH_SCOPE_MUT instead of _NO_FLUSH so that crashpad
re-serializes its cached crash event when release or environment
changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jpnurmi jpnurmi marked this pull request as ready for review March 6, 2026 08:57

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread src/sentry_session.c
`sentry_start_session()` already holds the scope lock, so pass the scope
pointer directly instead of re-acquiring it inside `sentry__session_new()`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@supervacuus supervacuus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, but I don't think we need to redo the DSC construction.

Comment thread src/sentry_core.c Outdated
Comment thread src/sentry_core.c Outdated
jpnurmi and others added 2 commits March 9, 2026 14:54
Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>
@jpnurmi jpnurmi merged commit a900aa4 into master Mar 9, 2026
83 of 84 checks passed
@jpnurmi jpnurmi deleted the jpnurmi/feat/update-release-env branch March 9, 2026 14:59
BernhardMarconato pushed a commit to elgatosf/sentry-native that referenced this pull request Apr 21, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: set release and environment after init

2 participants