-
-
Notifications
You must be signed in to change notification settings - Fork 435
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
Cleanup thread local context in ThreadLocalContextManager
after e…
#422
Conversation
…ach servlet request finishes.
@@ -21,4 +21,9 @@ public Context getContext() { | |||
return context.get(); | |||
} | |||
|
|||
@Override | |||
public void clear() { | |||
context.remove(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This it the critical difference. The rest is dealing with abstractions/naming.
I guess it's worth noting that this won't help if a user sets context stuff in a non-servlet thread. I don't have a good solution there if they are loading/unloading/reloading classes. |
CHANGES
Outdated
@@ -2,7 +2,8 @@ Version 1.1.1 | |||
------------- | |||
|
|||
- Allow overriding the location of the properties file. | |||
- Add support for handling and uploading Proguard files to Sentry (for Android applications). | |||
- Add support for handling and uploading Proguard files to Sentry (for Android applications).' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/'$//
…d of scheduled thread executor (#422)
…ach servlet request finishes.
This is for #420.
The issue was that threadlocals still held references to classes that were loaded with the old classloader -- and there was nothing to ever remove those old references.
I did some research, and there's no way to remove threadlocals except from the thread that created them (which makes sense). So for now, the only place we do cleanup is in the
SentryServletRequestListener
. That should cover most bases, because the most common use of "make a new classloader and reload my entire app" is in application servers that are using servlets.