-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-19049. Fix StatisticsDataReferenceCleaner classloader leak #6488
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
Conversation
💔 -1 overall
This message was automatically generated. |
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.
- worried about the risks...what does setting the value to null do
- testing?
@@ -4077,6 +4077,7 @@ private interface StatisticsAggregator<T> { | |||
STATS_DATA_CLEANER. | |||
setName(StatisticsDataReferenceCleaner.class.getName()); | |||
STATS_DATA_CLEANER.setDaemon(true); | |||
STATS_DATA_CLEANER.setContextClassLoader(null); |
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.
what are the risks of setting this to null?
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.
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 |
...mon-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java
Outdated
Show resolved
Hide resolved
🎊 +1 overall
This message was automatically generated. |
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.
+1
…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-binary
files?