Skip to content

Commit

Permalink
fix(sentry-sdk): Use existing scope in thread (#76624)
Browse files Browse the repository at this point in the history
If the scope is forked, tags set in the forked scope will not be set on
the event started on the original scope.
  • Loading branch information
Zylphrex committed Aug 28, 2024
1 parent 7e0fe49 commit 71ca69d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/sentry/utils/concurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ def submit(self, callable, priority=0, block=True, timeout=None):
task = PriorityTask(
priority,
(
sentry_sdk.Scope.get_isolation_scope().fork(),
sentry_sdk.Scope.get_current_scope().fork(),
sentry_sdk.Scope.get_isolation_scope(),
sentry_sdk.Scope.get_current_scope(),
callable,
future,
),
Expand Down
8 changes: 4 additions & 4 deletions src/sentry/utils/snuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,8 +1097,8 @@ def _bulk_snuba_query(snuba_requests: Sequence[SnubaRequest]) -> ResultSet:
_snuba_query,
[
(
sentry_sdk.Scope.get_isolation_scope().fork(),
sentry_sdk.Scope.get_current_scope().fork(),
sentry_sdk.Scope.get_isolation_scope(),
sentry_sdk.Scope.get_current_scope(),
snuba_request,
)
for snuba_request in snuba_requests_list
Expand All @@ -1110,8 +1110,8 @@ def _bulk_snuba_query(snuba_requests: Sequence[SnubaRequest]) -> ResultSet:
query_results = [
_snuba_query(
(
sentry_sdk.Scope.get_isolation_scope().fork(),
sentry_sdk.Scope.get_current_scope().fork(),
sentry_sdk.Scope.get_isolation_scope(),
sentry_sdk.Scope.get_current_scope(),
snuba_requests_list[0],
)
)
Expand Down

0 comments on commit 71ca69d

Please sign in to comment.