You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Thomas Koch <th...@koch.ro> on 2010/09/01 18:09:12 UTC
race condition in InvalidSnapShotTest on client close
Hi,
I believe, that I've found a race condition in
org.apache.zookeeper.server.InvalidSnapshotTest
In this test the server is closed before the client. The client, on close(),
submits as last package with type ZooDefs.OpCode.closeSession and waits for
this package to be finished.
However, nobody is there to awake the thread from packet.wait(). The
sendThread will on cleanup call packet.notifyAll() in finishpackage.
The race condition is: If an exception occurs in the sendThread, closing is
already true, so the sendThread breaks out of it's loop, calls cleanup and
finishes. If this happens, before the main thread calls packet.wait() then
there's nobody left to awake the main thread.
Regards,
Thomas Koch, http://www.koch.ro
Re: race condition in InvalidSnapShotTest on client close
Posted by Mahadev Konar <ma...@yahoo-inc.com>.
Hi Thomas,
Sorry for my late response. Please open a jira regarding this. Is this fixed in your netty patc hfor the client?
Htanks
mahadev
On 9/1/10 9:09 AM, "Thomas Koch" <th...@koch.ro> wrote:
Hi,
I believe, that I've found a race condition in
org.apache.zookeeper.server.InvalidSnapshotTest
In this test the server is closed before the client. The client, on close(),
submits as last package with type ZooDefs.OpCode.closeSession and waits for
this package to be finished.
However, nobody is there to awake the thread from packet.wait(). The
sendThread will on cleanup call packet.notifyAll() in finishpackage.
The race condition is: If an exception occurs in the sendThread, closing is
already true, so the sendThread breaks out of it's loop, calls cleanup and
finishes. If this happens, before the main thread calls packet.wait() then
there's nobody left to awake the main thread.
Regards,
Thomas Koch, http://www.koch.ro