[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13901065#comment-13901065
 ] 

Hudson commented on ZOOKEEPER-1861:
-----------------------------------

SUCCESS: Integrated in ZooKeeper-trunk #2217 (See 
[https://builds.apache.org/job/ZooKeeper-trunk/2217/])
ZOOKEEPER-1861. ConcurrentHashMap isn't used properly in QuorumCnxManager (Ted 
Yu via camille) (camille: 
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1568176)
* /zookeeper/trunk/CHANGES.txt
* 
/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java


> ConcurrentHashMap isn't used properly in QuorumCnxManager
> ---------------------------------------------------------
>
>                 Key: ZOOKEEPER-1861
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1861
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.5.0
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>            Priority: Minor
>             Fix For: 3.5.0
>
>         Attachments: zookeeper-1861-v1.txt, zookeeper-1861-v2.txt, 
> zookeeper-1861-v3.txt
>
>
> queueSendMap is a ConcurrentHashMap.
> At line 210:
> {code}
>             if (!queueSendMap.containsKey(sid)) {
>                 queueSendMap.put(sid, new ArrayBlockingQueue<ByteBuffer>(
>                         SEND_CAPACITY));
> {code}
> By the time control enters if block, there may be another concurrent put with 
> same sid to the ConcurrentHashMap.
> putIfAbsent() should be used.
> Similar issue occurs at line 307 as well.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to