Clear context class loader from started threads#7488
Clear context class loader from started threads#7488jkwatson merged 1 commit intoopen-telemetry:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7488 +/- ##
=========================================
Coverage 90.00% 90.00%
Complexity 7078 7078
=========================================
Files 803 803
Lines 21405 21408 +3
Branches 2086 2086
=========================================
+ Hits 19265 19268 +3
Misses 1477 1477
Partials 663 663 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
this seems fine. are there any downsides to removing the context class loader, though? What is it generally used for? |
Totally forgot this PR. Context class loader is used when code in the parent class loader needs to load a class from the child class loader. For example JDK uses it when you call |
|
@laurit I'm having an issue related with this PR here: quarkusio/quarkus#52252 The only alternative I found was to create a new MetricReader from the MetricReaderCustomizer. See: quarkusio/quarkus#52585 |
Thread inherits context class loader from the thread that started it. This could be problematic when a thread is started from an application thread. For example with the
StrictContextStorage(which is not used by default) some agent tests run on tomcat produce the following warningBasically this tells that even when you undeploy the application the resources can't be freed because there is thread that has a reference to the application class loader.