[
https://issues.apache.org/jira/browse/HADOOP-13254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15363388#comment-15363388
]
Robert Kanter commented on HADOOP-13254:
----------------------------------------
I'm concerned about this code in {{DiskValidatorFactory}}:
{code}
diskValidator = ReflectionUtils.newInstance(clazz, null);
// check the return of putIfAbsent() to see if any other thread
have put
// the instance with the same key into INSTANCES
DiskValidator diskValidatorRet =
INSTANCES.putIfAbsent(clazz, diskValidator);
if (diskValidatorRet != null) {
diskValidator = diskValidatorRet;
}
{code}
If the implementation of {{DiskValidator}} that is being created does something
like starting some threads, and {{putIfAbsent}} returns a previous
instantiation of the class, then we might have a problem. For example, if you
have a {{DiskValidator}} that starts off a background thread to poll SMART
status, you might end up with multiple background threads doing this.
> Create framework for configurable disk checkers
> -----------------------------------------------
>
> Key: HADOOP-13254
> URL: https://issues.apache.org/jira/browse/HADOOP-13254
> Project: Hadoop Common
> Issue Type: Bug
> Components: util
> Reporter: Yufei Gu
> Assignee: Yufei Gu
> Attachments: HADOOP-13254.001.patch, HADOOP-13254.002.patch,
> HADOOP-13254.003.patch, HADOOP-13254.004.patch, HADOOP-13254.005.patch,
> HADOOP-13254.006.patch, HADOOP-13254.007.patch, HADOOP-13254.008.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]