[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12616151#action_12616151
 ] 

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)


{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}

> 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