james strachan updated ZOOKEEPER-78:

    Attachment: using_zookeeper_facade.patch

This patch no longer requires ZOOKEEPER-84, we now use a ZooKeeperFacade which 
wraps up the creation of the ZooKeeper instance and allows it to be replaced if 
a SessionExpiredException occurs.

The test case works in the current patch. To get the test case to hang closing 
the 3rd client, just edit WriteLockTest and set the 
workAroundClosingLastZNodeFails field to a value of false. You will then get 
this stack dump when the test hangs (on OS X at least :)...

    [junit] "main" prio=5 tid=0x01001710 nid=0xb0801000 in Object.wait() 
    [junit]     at java.lang.Object.wait(Native Method)
    [junit]     - waiting on <0x096105e0> (a 
    [junit]     at java.lang.Object.wait(Object.java:474)
    [junit]     at 
    [junit]     - locked <0x096105e0> (a org.apache.zookeeper.ClientCnxn$Packet)
    [junit]     at org.apache.zookeeper.ZooKeeper.close(ZooKeeper.java:329)
    [junit]     - locked <0x0bd54108> (a org.apache.zookeeper.ZooKeeper)
    [junit]     at 
    [junit]     at 
    [junit]     at junit.framework.TestCase.runBare(TestCase.java:140)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:110)
    [junit]     at junit.framework.TestResult.runProtected(TestResult.java:128)
    [junit]     at junit.framework.TestResult.run(TestResult.java:113)
    [junit]     at junit.framework.TestCase.run(TestCase.java:124)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:232)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:227)
    [junit]     at 
    [junit]     at 
    [junit]     at 
    [junit]     at 
    [junit]     at 

This could maybe just be an OS X based timing issue

> added a high level protocol/feature - for easy Leader Election or exclusive 
> Write Lock creation
> -----------------------------------------------------------------------------------------------
>                 Key: ZOOKEEPER-78
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-78
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>    Affects Versions: 3.0.0
>            Reporter: james strachan
>            Assignee: james strachan
>         Attachments: patch_with_including_Benjamin's_fix.patch, 
> using_zookeeper_facade.patch
> Here's a patch which adds a little WriteLock helper class for performing 
> leader elections or creating exclusive locks in some directory znode. Note 
> its an early cut; am sure we can improve it over time. The aim is to avoid 
> folks having to use the low level ZK stuff but provide a simpler high level 
> abstraction.

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