[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

yuemeng updated ZOOKEEPER-2375:
-------------------------------
    Description: 
If there are exist many ZooKeeperSaslClient instance in one process,each 
ZooKeeperSaslClient instance will be call synchronize method 
createSaslClient,But each ZooKeeperSaslClient instance will be lock the current 
object(that is say ,the synchronize only for lock it's own object) ,but many 
instances can access the static variable login,the synchronize can't prevent 
other threads access the static login object,it will be cause more than one 
ZooKeeperSaslClient  instances use the same login object,and 
login.startThreadIfNeeded() will be called more than one times for same thread 
object。
it wll cause problem:
 ERROR | [Executor task launch worker-1-SendThread(fi1:24002)] | Exception 
while trying to create SASL client: java.lang.IllegalThreadStateException | 
org.apache.zookeeper.client.ZooKeeperSaslClient.createSaslClient(ZooKeeperSaslClient.java:305)

  was:
If there are exist many ZooKeeperSaslClient instance in one process,each 
ZooKeeperSaslClient instance will be call synchronize method 
createSaslClient,But each ZooKeeperSaslClient instance will be lock the current 
object(that is say ,the synchronize only for lock it's onwe object) ,but many 
instances can access the static variable login,the synchronize can't prevent 
other threads access the static login object,it will be cause more than one 
ZooKeeperSaslClient  instances use the same login object,and 
login.startThreadIfNeeded() will be called more than one times for same thread 
object。
it wll cause problem:
 ERROR | [Executor task launch worker-1-SendThread(fi1:24002)] | Exception 
while trying to create SASL client: java.lang.IllegalThreadStateException | 
org.apache.zookeeper.client.ZooKeeperSaslClient.createSaslClient(ZooKeeperSaslClient.java:305)


> The synchronize method of createSaslClient in ZooKeeperSaslClient can't be 
> synchronize
> --------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2375
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2375
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>    Affects Versions: 3.4.6, 3.4.8, 3.5.0, 3.5.1
>            Reporter: yuemeng
>             Fix For: 3.5.2
>
>
> If there are exist many ZooKeeperSaslClient instance in one process,each 
> ZooKeeperSaslClient instance will be call synchronize method 
> createSaslClient,But each ZooKeeperSaslClient instance will be lock the 
> current object(that is say ,the synchronize only for lock it's own object) 
> ,but many instances can access the static variable login,the synchronize 
> can't prevent other threads access the static login object,it will be cause 
> more than one ZooKeeperSaslClient  instances use the same login object,and 
> login.startThreadIfNeeded() will be called more than one times for same 
> thread object。
> it wll cause problem:
>  ERROR | [Executor task launch worker-1-SendThread(fi1:24002)] | Exception 
> while trying to create SASL client: java.lang.IllegalThreadStateException | 
> org.apache.zookeeper.client.ZooKeeperSaslClient.createSaslClient(ZooKeeperSaslClient.java:305)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to