Skip to content

fix(tracing): handle exceptions raised within traces_sampler and other callbacks - #6853

Merged
ericapisani merged 9 commits into
masterfrom
py-2617-handle-exceptions-combined
Jul 21, 2026
Merged

fix(tracing): handle exceptions raised within traces_sampler and other callbacks#6853
ericapisani merged 9 commits into
masterfrom
py-2617-handle-exceptions-combined

.

99fb778
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed Jul 21, 2026 in 0s

1 issue

Medium

BaseException in before_send callbacks bypasses exception recovery logic - `sentry_sdk/client.py:1250-1252`

except Exception inside capture_internal_exceptions() does not set exception_raised_in_before_send_func for KeyboardInterrupt, SystemExit, or other BaseException subclasses. For log/metric this means mutated items are queued instead of dropped; for streamed spans partial mutations are applied instead of being reset to the original.

4 skills analyzed
Skill Findings Duration Cost
security-review 0 1m 5s $0.59
code-review 0 16m 16s $0.42
find-bugs 1 36m 19s $1.64
skill-scanner 0 18m $0.04

⏱ 71m 40s · 5.8M in / 187.9k out · $2.69