james strachan commented on ZOOKEEPER-63:

BTW here's the hang I seem to be able to get quite easily using the test case 
WriteLockTest in the ZOOKEEPER-78 patch (you need to set 
workAroundClosingLastZNodeFails to false to make it hang)

   [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
   [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

> Race condition in client close() operation
> ------------------------------------------
>                 Key: ZOOKEEPER-63
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-63
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: java client
>            Reporter: Patrick Hunt
>            Assignee: Benjamin Reed
> There is a race condition in the java close operation on ZooKeeper.java.
> Client is sending a disconnect request to the server. Server will close any 
> open connections with the client when it receives this. If the client has not 
> yet shutdown it's subthreads (event/send threads for example) these threads 
> may consider the condition an error. We see this alot in the tests where the 
> clients output error logs because they are unaware that a disconnection has 
> been requested by the client.
> Ben mentioned: perhaps we just have to change state to closed (on client) 
> before sending disconnect request.

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