Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent Memory leaks from sentry-tower #417

Merged
merged 4 commits into from
Jan 25, 2022
Merged

Conversation

Swatinem
Copy link
Member

@Swatinem Swatinem commented Jan 24, 2022

The TowerService::call seems to just create futures, and is not running in the context of a parent layers future. Also the other way around, SentryService didn’t wrap the call in a Hub either.

The TowerService::call seems to just create futures, and is not running in the context of a parent layers future.
@Swatinem Swatinem requested a review from a team January 24, 2022 16:12
@loewenheim
Copy link
Contributor

Let me see if I understand this correctly. You're moving some code from the function that creates the future to the first poll of the future because the way it was originally, the closure in sentry::configure_scope would be kept around too long?

@Swatinem
Copy link
Member Author

Its rather 2 issues:

  1. The "caller" in the SentryService did not wrap the actual call function with a hub, wrongly assuming that every async fn is lazy.
  2. The "callee" in the SentryHttpService was executing synchronous code in its own call, violating the assumption that async fn should be lazy.

@Swatinem Swatinem merged commit acb6f63 into master Jan 25, 2022
@Swatinem Swatinem deleted the fix/leaky-tower branch January 25, 2022 10:51
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.

None yet

2 participants