-
Notifications
You must be signed in to change notification settings - Fork 867
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
Add context leak debugger #860
Conversation
While we discussed that the gRPC context override is a strange API how about using it here so it affects all instrumentation, not just executor? This change reminds me a lot of brave's strict scope decorator, which we should copy as much as we can from |
Here's an example of a context leak log for the sporadic failure in #430:
|
Did you happen to think about the more generic approach? Maybe in a future PR? |
Oh sorry I forgot about that. Yes, we should do that, especially given our concerns about context propagation across threads. I just opened #874 to track. |
Based on @iNikem's findings in #787.
E.g. in #787, @iNikem found that the context leak sometimes leaks into the Tomcat thread pool via
AsyncContext.dispatch()
. And so to prevent that particular leak we could instrumentAsyncContext.dispatch()
and push an empty context into scope.This debug option (which is enabled by default when running tests) will hopefully help to track down the source of these leaks, and then we can see if we can fix them (similar to
AsyncContext.dispatch()
example above).