Open
Description
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.12.0
Steps to Reproduce
Noticed the following error in the asyncio integration. It crashes the program. I have the following init:
sentry_sdk.init(
dsn=settings.sentry_dsn,
environment=settings.env,
integrations=[
AsyncioIntegration(),
LoguruIntegration(),
FastApiIntegration(),
OpenAIIntegration(),
RedisIntegration(),
HttpxIntegration(),
AioHttpIntegration(),
],
traces_sample_rate=1.0,
profiles_sample_rate=1.0,
)
Can it be somehow related to #2908?
Expected Result
No crash.
Actual Result
Traceback (most recent call last):
File "/venv/lib/python3.11/site-packages/sentry_sdk/integrations/asyncio.py", line 46, in _coro_creating_hub_and_span
with sentry_sdk.isolation_scope():
File "/venv/lib/python3.11/site-packages/sentry_sdk/scope.py", line 1628, in isolation_scope
_current_scope.reset(current_token)
File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
self.gen.throw(typ, value, traceback)
ValueError: <Token var=<ContextVar name='current_scope' default=None at 0x7cc13c5a72e0> at 0x7cc0dc4eb880> was created in a different Context
Metadata
Assignees
Type
Projects
Status
Waiting for: Community
Activity