python-zk/kazoo — pull request #170 by jborg (2014-02-20 09:38:36+00:00)
Title: Fix Lock deadlock on CONNECTED->SUSPENDED->CONNECTED state change

Restarting the zookeeper leader node when two or more instances
of the following program are running will deadlock indefinitely.

```python
from __future__ import print_function
from kazoo.client import KazooClient
import time

zk = KazooClient('node1,node2,node3')
zk.add_listener(lambda state: print(state))
zk.start()
lock = zk.Lock('/test')
while True:
with lock:
print('lock acquired')
time.sleep(1)
print('lock released')
```

Fix and test case included