HADOOP-19049. Fix StatisticsDataReferenceCleaner classloader leak#6488
Conversation
|
💔 -1 overall
This message was automatically generated. |
steveloughran
left a comment
There was a problem hiding this comment.
- worried about the risks...what does setting the value to null do
- testing?
| STATS_DATA_CLEANER. | ||
| setName(StatisticsDataReferenceCleaner.class.getName()); | ||
| STATS_DATA_CLEANER.setDaemon(true); | ||
| STATS_DATA_CLEANER.setContextClassLoader(null); |
There was a problem hiding this comment.
what are the risks of setting this to null?
There was a problem hiding this comment.
If the thread relies on the return value of Thread.currentThread().getContextClassLoader() for logical processing, it may encounter NPE, but I checked the corresponding code. This risk should not exist. In fact, this is a normal way of handling classloader references in the daemon thread. You can refer https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-7008595
Adding... |
|
those java links have convinced me; StreamCloser in the jdk does exactly this. If you can do a test for this -fine. but it may be too hard to write a test for...in which case I will merge as is |
|
🎊 +1 overall
This message was automatically generated. |
…ache#6488) Contributed by Jia Fan
Description of PR
This PR fix StatisticsDataReferenceCleaner thread class loader leak problem. Before start it we should make sure it can not reference class loader.
How was this patch tested?
Add new test.
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?