fix: Introduce _get_current_streamed_span() to keep types backwards compatible
#6177
@sentry/warden / warden: code-review
completed
Apr 30, 2026 in 1m 53s
1 issue
code-review: Found 1 issue (1 low)
Low
Client lookup moved outside capture_internal_exceptions guard in _set_status - `sentry_sdk/integrations/celery/__init__.py:101-102`
The new code calls sentry_sdk.get_client() and has_span_streaming_enabled(client.options) outside the with capture_internal_exceptions(): block. Previously, all logic in _set_status was protected so that any internal SDK error would be swallowed. Since _set_status is invoked from _capture_exception during task error handling, an unexpected exception here (e.g., due to an uninitialized/NonRecordingClient state or a future change to has_span_streaming_enabled) would now propagate into user code rather than being captured internally, potentially masking the original task error.
Duration: 1m 53s · Tokens: 647.6k in / 8.5k out · Cost: $2.80
Loading