Skip to content

ref(tornado): Use new scopes API#2907

Merged
sentrivana merged 2 commits intosentry-sdk-2.0from
ivana/2.0/tornado-new-scopes
Mar 27, 2024
Merged

ref(tornado): Use new scopes API#2907
sentrivana merged 2 commits intosentry-sdk-2.0from
ivana/2.0/tornado-new-scopes

Conversation

@sentrivana
Copy link
Copy Markdown
Contributor

@sentrivana sentrivana commented Mar 26, 2024

Forgot to give the Tornado integration the new scopes treatment -- fixing that now.

This integration is a bit special because trying to update it to the new API leads to the tests failing with

ValueError: <Token var=<ContextVar name='isolation_scope' default=None at 0x1049e8c70> at 0x104ecf080> was created in a different Context

when trying to restore the old isolation and current contexts at the end of with isolation_scope(). Digging deeper, I came across a Tornado issue. There's a fix in Tornado 6 and also in our case, everything seems to work on 6.0 up, so I'm dropping support for older Tornado to make sure contextvars work correctly. 6.0 itself is already 5 years old so I think we can afford to drop support for older versions.

@sentrivana sentrivana force-pushed the ivana/2.0/tornado-new-scopes branch from 92e0dd9 to 7c89241 Compare March 27, 2024 14:01
@sentrivana sentrivana marked this pull request as ready for review March 27, 2024 14:14
@sentrivana sentrivana merged commit c06bf06 into sentry-sdk-2.0 Mar 27, 2024
@sentrivana sentrivana deleted the ivana/2.0/tornado-new-scopes branch March 27, 2024 15:52
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.

2 participants