Skip to content

Conversation

@untitaker
Copy link
Member

Fix #1057

with Hub(hub) as hub:
with hub.configure_scope() as scope:
scope.clear_breadcrumbs()
processor = _make_event_processor(weak_handler) # type: ignore
Copy link
Contributor

@ahmedetefy ahmedetefy Mar 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not have the same issue as #1034 , the weak_handler is not accessible within the tornado_processor inner func https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/tornado.py#L135

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, but I believe self will stick around for the duration of the request handler invocation, which sticks around for the duration of the response streaming, so it should be fine afaict

let me add a test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the test you added covers that case since that request raises an exception and so triggers the error handler.
I would create another test to check if the request body exists when the request doesn't raise an exception and returns a success status code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually the exception won't make the request stay around for longer, but you're right it's not the same testcase so I added another one.

@untitaker untitaker force-pushed the feat/tornado-transaction branch from 7ec583d to 7f65e71 Compare March 19, 2021 11:23
@ahmedetefy ahmedetefy self-requested a review March 19, 2021 11:39
Copy link
Member

@lobsterkatie lobsterkatie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@untitaker untitaker merged commit 4c09f32 into master Mar 24, 2021
@untitaker untitaker deleted the feat/tornado-transaction branch March 24, 2021 19:22
@untitaker
Copy link
Member Author

Yup will do, thanks.

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.

Add performance monitoring to Tornado integration

4 participants