[
https://issues.apache.org/jira/browse/HDFS-13990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16655642#comment-16655642
]
Hudson commented on HDFS-13990:
-------------------------------
SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #15255 (See
[https://builds.apache.org/job/Hadoop-trunk-Commit/15255/])
HDFS-13990. Synchronization Issue With HashResolver. Contributed by (inigoiri:
rev 1e78dfca40ed2242bf7785e6f23672c40931bf79)
* (edit)
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/order/HashResolver.java
> Synchronization Issue With HashResolver
> ---------------------------------------
>
> Key: HDFS-13990
> URL: https://issues.apache.org/jira/browse/HDFS-13990
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: federation
> Affects Versions: 3.2.0
> Reporter: BELUGA BEHR
> Assignee: BELUGA BEHR
> Priority: Minor
> Fix For: 3.3.0
>
> Attachments: HDFS-13990.1.patch, HDFS-13990.2.patch,
> HDFS-13990.2.patch
>
>
> {code:java|title=HashResolver.java}
> private ConsistentHashRing getHashResolver(final Set<String> namespaces) {
> int hash = namespaces.hashCode();
> ConsistentHashRing resolver = this.hashResolverMap.get(hash);
> if (resolver == null) {
> resolver = new ConsistentHashRing(namespaces);
> this.hashResolverMap.put(hash, resolver);
> }
> return resolver;
> }
> {code}
> The {{hashResolverMap}} is a {{ConcurrentHashMap}} so presumably there is
> concern here for concurrency issues. However, there is no synchronization
> around this method, so two threads could call {{get(hash)}} both see a 'null'
> value and then both add two entries into the {{Map}}. Add synchronization
> here.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]