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

Thomas Koch updated ZOOKEEPER-837:
----------------------------------

    Attachment: ZOOKEEPER-837.patch

Hi Mahadev,

the inconsistent synchronization has been that way before and I didn't touch 
it. As I've written in the javadocs there are many issues that needs to be 
fixed, but I'd prefer to do them one at a time. I've documented the 
synchronization issue in the javadoc too.
I've also made ZooKeeper.register unsynchronized. It was synchronized before, 
but all read accesses to the defaultWatcher were unsynchronized, so the 
synchronized was senseless. It was also not necessary because the 
defaultWatcher was declared volatile and access to it was atomic (just get/set) 
all the time.

> cyclic dependency ClientCnxn, ZooKeeper
> ---------------------------------------
>
>                 Key: ZOOKEEPER-837
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-837
>             Project: ZooKeeper
>          Issue Type: Sub-task
>    Affects Versions: 3.3.1
>            Reporter: Patrick Datko
>            Assignee: Thomas Koch
>             Fix For: 3.4.0
>
>         Attachments: ZOOKEEPER-837.patch, ZOOKEEPER-837.patch, 
> ZOOKEEPER-837.patch, ZOOKEEPER-837.patch, ZOOKEEPER-837.patch
>
>
> ZooKeeper instantiates ClientCnxn in its ctor with this and therefor builds a 
> cyclic dependency graph between both objects. This means, you can't have the 
> one without the other. So why did you bother do make them to separate classes 
> in the first place?
> ClientCnxn accesses ZooKeeper.state. State should rather be a property of 
> ClientCnxn. And ClientCnxn accesses zooKeeper.get???Watches() in its method 
> primeConnection(). I've not yet checked, how this dependency should be 
> resolved better.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to