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

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 :)...

{code}
    [junit] "main" prio=5 tid=0x01001710 nid=0xb0801000 in Object.wait() 
[0xb07ff000..0xb0800148]
    [junit]     at java.lang.Object.wait(Native Method)
    [junit]     - waiting on <0x096105e0> (a 
org.apache.zookeeper.ClientCnxn$Packet)
    [junit]     at java.lang.Object.wait(Object.java:474)
    [junit]     at 
org.apache.zookeeper.ClientCnxn.submitRequest(ClientCnxn.java:822)
    [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 
org.apache.zookeeper.protocols.ZooKeeperFacade.close(ZooKeeperFacade.java:99)
    [junit]     at 
org.apache.zookeeper.protocols.WriteLockTest.tearDown(WriteLockTest.java:146)
    [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 
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
    [junit]     at 
junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:36)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:421)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
    [junit]     at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)
{code}

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