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

Only reset server context if there is a leak. #2876

Merged
merged 2 commits into from Apr 28, 2021

Conversation

anuraaga
Copy link
Contributor

Resetting to root was always a hack that we accepted out of necessity for leaking instrumentations. But we reached the end of the line :) Context is a shared resource and who knows what's been added to it before we get a chance to create a span, resetting it arbitrarily isn't really allowed. This new version is still not ideal but at least improves the situation a bit.

Fixes #2853

// possible spans that instrumentation may have added and such frameworks as of now do not
// have leaks.
parent = Context.root();
}
Copy link
Member

Choose a reason for hiding this comment

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

Should we add the same logic to ServerInstrumenter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm - I guess it probably should have the logic, let's do it in a separate PR since we might get lucky and solve our context leak issues before migrating to ServerInstrumenter? :P :D

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

Resetting to root was always a hack that we accepted out of necessity for leaking instrumentations. But we reached the end of the line :) Context is a shared resource and who knows what's been added to it before we get a chance to create a span, resetting it arbitrarily isn't really allowed. This new version is still not ideal but at least improves the situation a bit.

Fixes #2853

👍

@anuraaga anuraaga merged commit a66a13f into open-telemetry:main Apr 28, 2021
@anuraaga anuraaga mentioned this pull request Apr 30, 2021
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.

gRPC instrumentation breaks ProtoReflectionService
3 participants