ClientCnxn.authInfo must be thread safe
---------------------------------------

                 Key: ZOOKEEPER-895
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-895
             Project: Zookeeper
          Issue Type: Bug
            Reporter: Thomas Koch


authInfo can be accessed concurrently by different Threads, as exercised in 
org.apache.zookeeper.test.ACLTest

The two concurrent access points in this case were (presumably):
org.apache.zookeeper.ClientCnxn$SendThread.primeConnection(ClientCnxn.java:805) 
and
org.apache.zookeeper.ClientCnxn.addAuthInfo(ClientCnxn.java:1121)

The line numbers refer to the latest patch in ZOOKEEPER-823.

The exception that pointed to this issue:
    [junit] 2010-10-13 09:35:55,113 [myid:] - WARN  
[main-SendThread(localhost:11221):clientcnxn$sendthr...@713] - Session 0x0 for 
server localhost/127.0.0.1:11221, unexpected error, closing socket connection 
and attempting reconnect
    [junit] java.util.ConcurrentModificationException
    [junit]     at 
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
    [junit]     at java.util.AbstractList$Itr.next(AbstractList.java:343)
    [junit]     at 
org.apache.zookeeper.ClientCnxn$SendThread.primeConnection(ClientCnxn.java:805)
    [junit]     at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:247)
    [junit]     at 
org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:694)

Proposed solution: Use a thread save list for authInfo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to